Skip to content

Returns the first day of the year for a date or a date with time (timestamp/datetime).

func.to_start_of_year(<expr>)
func.to_start_of_year('2023-11-12 09:38:18.165575')
┌────────────────────────────────────────────────────────────────┐
│ func.to_start_of_year('2023-11-12 09:38:18.165575') │
│ Date │
├────────────────────────────────────────────────────────────────┤
2023-01-01
└────────────────────────────────────────────────────────────────┘
TO_START_OF_YEAR(<expr>)
ArgumentsDescription
<expr>date/timestamp

DATE, returns date in “YYYY-MM-DD” format.

SELECT
to_start_of_year('2023-11-12 09:38:18.165575')
┌────────────────────────────────────────────────┐
│ to_start_of_year('2023-11-12 09:38:18.165575') │
Date
├────────────────────────────────────────────────┤
2023-01-01
└────────────────────────────────────────────────┘