PostgreSQL JUSTIFY INTERVAL Function

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PostgreSQL JUSTIFY_INTERVAL() function

JUSTIFY_INTERVAL() function

This function is used to adjust interval using justify_days and justify_hours, with additional sign adjustments.

Syntax :

justify_interval(interval)

Return Type : interval.

PostgreSQL Version : 9.3

Pictorial Presentation of PostgreSQL JUSTIFY_INTERVAL() function

Example : PostgreSQL JUSTIFY_INTERVAL() function

SELECT justify_interval(interval '1 mon -1 hour');

Output :

justify_interval
------------------
 29 days 23:00:00
(1 row)