Skip to content
masterclass Buddy

PostgreSQL · Function

date_trunc

date_trunc cuts a date/time value down to a chosen precision, such as hour, day, month, or year. It returns the same general value type, with smaller fields cleared.

Last updated

Syntax

date_trunc(field, source [, time_zone])

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • date_bin
  • extract
  • AT TIME ZONE
  • timestamp with time zone

Source: PostgreSQL: Documentation: 18: 9.9. Date/Time Functions and Operators. Checked 2026-11-03.