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
orTIMESTAMP
expression.
Examples
DAYOFWEEK exampleSELECT DAYOFWEEK(DATE '2021-02-28')
-- 1
SELECT DAYOFWEEK(TIMESTAMP '2021-02-27 11:43:22')
-- 7