Skip to main content
Version: Latest-3.2

dayofyear

Description

Returns the day of the year for a given date.

The date parameter must be of the DATE or DATETIME type.

Syntax

INT DAYOFYEAR(DATETIME|DATE date)

Examples

MySQL > select dayofyear('2007-02-03 00:00:00');
+----------------------------------+
| dayofyear('2007-02-03 00:00:00') |
+----------------------------------+
| 34 |
+----------------------------------+

keyword

DAYOFYEAR