Skip to main content

toDayOfYear

Converts a date or date with time to a UInt16 number containing the number of the day of the year (1-366).

Syntax

toDayOfYear(expr)

Arguments

ArgumentsDescription
exprdate16/date32/datetime

Return Type

A UInt16 number datatype.

Examples

mysql> select toDayOfYear(toDate(18869));
+----------------------------+
| toDayOfYear(toDate(18869)) |
+----------------------------+
| 242 |
+----------------------------+

mysql> select toDayOfYear(now());
+--------------------+
| toDayOfYear(now()) |
+--------------------+
| 88 |
+--------------------+