Truncate date to hour | DATE_TRUNCATE_TO_HOUR

Syntax

DATE_TRUNCATE_TO_HOUR( [value = CURRENT_DATE()] )

Parameters

value
A DATE value. If the value is not a DATE, it will be converted to one with the DATE operation.

Return Value

Returns the truncated DATE

Description

Set the minute, seconds and milliseconds values of a DATE to 0.

Examples

DATE_TRUNCATE_TO_HOUR("2017-08-30T17:36:23.700Z") # returns DATE("2017-08-30T17:00:00.000Z")