DateTrunc
Last updated
Was this helpful?
Last updated
Was this helpful?
Truncates the date to the specified date part.
precision (required) Smallest date part to preserve, chosen from “year”, "quarter", “month”, “week”, "week_starting_sunday", "week_starting_monday", “day”, “hour”, “minute”, and “second”. If "week" is selected, DateTrunc will have weeks start on Sunday. Parameters can be used to specify precision.
date (required) Date to be truncated.
timezone (optional) Name of to get the date part at, e.g.”America/Los_Angeles”. When calculating a time zone, input dates are treated as UTC.
📘The output returned is presented in the organization's time zone. This may cause days, months, or years to appear offset if the specified time zone is ahead of the organization time zone. To view the output presented in the specified time zone, you can apply ConvertTimeZone to it.
Returns 1980-05-22 8:00:00, discarding the “minute” and ”second” components of the date.
Returns 1980-05-22 00:00:00, discarding the time components of the date.