v.24.4Improvement
Functions date_diff and age Enhanced for Nanosecond Precision
Functionsdate_diffandagenow calculate their result at nanosecond instead of microsecond precision. They now also offernanosecond(ornanosecondsorns) as a possible value for theunitparameter. #61409 (Austin Kothig).
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 theunit parameter as 'nanosecond', 'nanoseconds', or 'ns' when calling the date_diff or age functions to get results with nanosecond precision.