Truncate date to day | DATE_TRUNCATE_TO_DAY

Syntax

DATE_TRUNCATE_TO_DAY( [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 hour, minute, seconds and milliseconds values of a DATE to 0.

Examples

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