Retrieve the day of the year from a given date.
SELECT DAYOFYEAR(“2017-06-15”); |
The DAYOFYEAR() function retrieves the day of the year for a specified date, represented as a number ranging from 1 to 366.
DAYOFYEAR(date) |
Parameter |
Description |
date |
Necessary. Specify the date from which to retrieve the day of the year. |
Works in: |
From MySQL version 4.0 |
Determine the day of the year for a given date.
SELECT DAYOFYEAR(“2017-01-01”); |
Retrieve the day of the year for today’s date.
SELECT DAYOFYEAR(CURDATE()); |