SQL Notebook (logo)

DATE_TRUNC Function

Returns a new date by finding the nearest specified calendar or clock division prior to the specified source date.

Syntax

DATE_TRUNC(date-part, date)

Arguments

Return Value

A date/time with time zone offset (i.e. a string like "2016-07-23 21:00:00.000 -04:00"), calculated by finding the nearest specified time division prior to the specified date.

Examples