On this page

    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 or TIMESTAMP expression.

    Examples

    DAYOFYEAR example
    SELECT DAYOFYEAR(DATE '2021-02-28')
    -- 59
    
    DAYOFYEAR example
    SELECT DAYOFYEAR(TIMESTAMP '2021-03-15 11:43:22')
    -- 74