Syntax

    DATETIME TIME_ROUND(DATETIME expr, INT period)

    DATETIME TIME_ROUND(DATETIME expr, INT period, DATETIME origin)

    • TIME: SECOND, MINUTE, HOUR, DAY, , MONTH, YEAR

    Returns the upper/lower bound of expr.

    • period specifies how many TIME units, the default is 1.
    • specifies the start time of the period, the default is 1970-01-01T00:00:00, the start time of WEEK is Sunday, which is 1970-01-04T00:00:00. Could be larger than expr.