MySQL Tutorial/Date Time Functions/DAYOFYEAR
DAYOFYEAR(date) returns the day of the year for date, in the range 1 to 366.
mysql>
mysql>
mysql> SELECT DAYOFYEAR("1998-02-03");
+-------------------------+
| DAYOFYEAR("1998-02-03") |
+-------------------------+
| 34 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
Pass DAYOFYEAR a date as a string parameter:
mysql>
mysql> SELECT DAYOFYEAR("2000/02/01");
+-------------------------+
| DAYOFYEAR("2000/02/01") |
+-------------------------+
| 32 |
+-------------------------+
1 row in set (0.00 sec)
mysql>