extractdoy
extractdoy is a date-related function used to compute the day of the year from a calendar date. The function returns an integer representing the ordinal day, where January 1 is 1 and December 31 is 365 in common years or 366 in leap years.
Inputs are typically a date, datetime, or timestamp value. The function ignores time-of-day and uses only the
Output is an integer in the range 1–366.
Leap-year behavior: February 29 is day 60 on leap years.
Examples: extractdoy('2023-02-15') yields 46. extractdoy('2020-02-29') yields 60.
Common usage: It is often provided as a built-in function or as part of a date-part extraction
Limitations: If the input date cannot be parsed, the function may raise an error or return null.