Valid values: timestamp, timestamptz, or interval. DATE_TRUNC casts values of type date and time to timestamp or interval, respectively.
Optional
<time_zone>: The time zone to truncate with respect to. Applies only to timestamptz input. By default, DATE_TRUNC uses the current time zone.
<fiscal_option>: A fiscal calendar option that defines the start date of the fiscal calendar. <source> must be of type date, timestamp, or timestamptz, and <field> must be fiscal_week, fiscal_month, fiscal_quarter, or fiscal_year. See Fiscal Calendar Options.
first_day_of_localized_week => <value>: A localized week option that defines the start of a week. <source> must be of type date, timestamp, or timestamptz, and <field> must be localized_week. See Localized Week Options.
Returns
Returns a timestamp, timestamptz, or interval value that matches the type of the source.
Considerations
<source> can’t be of type interval when <field> is week, because a month can contain a fractional number of weeks.
You can’t provide a time zone with timestamp or interval input.
With timestamptz input, DATE_TRUNC truncates with respect to a time zone. For example, truncating to day produces the value that is midnight in that zone.
Examples
These examples assume the local time zone is America/New_York.