v.24.4Improvement
Added nano, micro, and millisecond units to date_trunc
Why it matters
This feature enhances thedate_trunc function by allowing users to truncate dates to finer time units (nanoseconds, microseconds, and milliseconds). It solves the limitation of the previous versions where only coarser units were supported, enabling more precise time-based data manipulation and aggregation.How to use it
Use thedate_trunc function with the new time units by specifying the unit parameter as 'nano', 'micro', or 'millisecond'. For example:SELECT date_trunc('microsecond', some_datetime_column) FROM table