w3resource

PostgreSQL JUSTIFY_HOURS() function

JUSTIFY_HOURS() function

This function is used to adjust interval so 24-hour time periods are represented as days.

Syntax:

justify_hours(interval)

Return Type: interval.

PostgreSQL Version: 9.3

Pictorial Presentation of PostgreSQL JUSTIFY_HOURS() function

Pictorial presentation of PostgreSQL JUSTIFY_HOURS() function

Example: PostgreSQL JUSTIFY_HOURS() function:

Code:

SELECT justify_hours(interval '32 hours');

Sample Output:

 justify_hours
----------------
 1 day 08:00:00
(1 row)

Previous: JUSTIFY_DAYS function
Next: JUSTIFY_INTERVAL function



Share this Tutorial / Exercise on : Facebook and Twitter