Date Truncate Function
The date_trunc function supports the given below units. The examples in the table use timestamp 2000-08-05T09:05:10 as an input.
unit
Truncated example value
second
2000-08-05T09:05:10
minute
2000-08-05T09:05:00
hour
2000-08-05T09:00:00
day
2000-08-05T00:00:00
week
2000-07-31T00:00:00
month
2000-08-01T00:00:00
quarter
2000-07-01T00:00:00
year
2000-01-01T00:00:00
DATE_TRUNC( unit, <datetime_expr> )
Returns the input expression truncated to a given unit
(refer above table).
Supported datatype : Date/Timestamp
TRUNC( <datetime_expr>, unit )
Returns the input expression truncated to a given unit
(refer above table).
Supported datatype : Date/Timestamp
Last updated