mysql>
mysql>
mysql> SELECT DAYOFYEAR('2004-12-31 23:59:59');
+----------------------------------+
| DAYOFYEAR('2004-12-31 23:59:59') |
+----------------------------------+
| 366 |
+----------------------------------+
1 row in set (0.00 sec)
mysql>