跳到主要内容

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
<expr>date/datetime

Return Type

A UInt16 number datatype.

Examples

SELECT toDayOfYear(to_date(18869));
+----------------------------+
| toDayOfYear(to_date(18869)) |
+----------------------------+
| 242 |
+----------------------------+

SELECT toDayOfYear(now());
+--------------------+
| toDayOfYear(now()) |
+--------------------+
| 88 |
+--------------------+