Skip to main content
Version: 24.3.x

Categories: Date/Time

DAYOFWEEK

Returns the day of the week (from 1 to 7) of the date or timestamp.

Syntax

DAYOFWEEK(date_timestamp_expression string) → bigint

  • date_timestamp_expression: A DATE or TIMESTAMP expression.

Examples

DAYOFWEEK example
SELECT DAYOFWEEK(DATE '2021-02-28')
-- 1
DAYOFWEEK example
SELECT DAYOFWEEK(TIMESTAMP '2021-02-27 11:43:22')
-- 7