Materialize Documentation
Join the Community github/materialize

justify_interval function

justify_interval returns a new interval such that 30-day time periods are converted to months, 24-hour time periods are represented as days, and all fields have the same sign. It is a combination of ‘justify_days’ and ‘justify_hours’ with additional sign adjustment.


justify_interval ( interval )
Parameter Type Description
interval interval The interval value to justify.

Return value

justify_interval returns an interval value.


SELECT justify_interval(interval '1 mon -1 hour');
 29 days 23:00:00