Back to Starrocks

to_days

docs/en/sql-reference/sql-functions/date-time-functions/to_days.md

4.1.0413 B
Original Source

to_days

Returns the number of days between a date and 0000-01-01.

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

Syntax

Haskell
INT TO_DAYS(DATETIME date)

Examples

Plain
MySQL > select to_days('2007-10-07');
+-----------------------+
| to_days('2007-10-07') |
+-----------------------+
|                733321 |
+-----------------------+

keyword

TO_DAYS,TO,DAYS