v.24.4Improvement

Functions date_diff and age Enhanced for Nanosecond Precision

Functions date_diff and age now calculate their result at nanosecond instead of microsecond precision. They now also offer nanosecond (or nanoseconds or ns) as a possible value for the unit parameter. #61409 (Austin Kothig).
Functions date_diff and age now support nanosecond precision for their calculations and accept nanosecond, nanoseconds, or ns as valid units.

Why it matters

This feature enhances the time difference calculations by increasing their precision from microseconds to nanoseconds, allowing users to perform more accurate temporal measurements and comparisons at the nanosecond level.

How to use it

Users can simply specify the unit parameter as 'nanosecond', 'nanoseconds', or 'ns' when calling the date_diff or age functions to get results with nanosecond precision.