Categories: Date/Time
DAYOFYEAR
Returns the day of the year (from 1 to 366) of the date or timestamp.
Syntax
DAYOFYEAR(date_timestamp_expression string) → bigint
- date_timestamp_expression: A
DATE
orTIMESTAMP
expression.
Examples
DAYOFYEAR exampleSELECT DAYOFYEAR(DATE '2021-02-28')
-- 59
SELECT DAYOFYEAR(TIMESTAMP '2021-03-15 11:43:22')
-- 74