Skip to main content

FROM_DAYS

Description​

Given a number of days, returns a DATE.

  • Note: To maintain consistent behavior with MySQL, the date 0000-02-29 does not exist.

Syntax​

FROM_DAYS(<dt>)

Parameters​

ParameterDescription
<dt>Days

Return Value​

Returns the date corresponding to the given number of days.

Examples​

select from_days(730669),from_days(5),from_days(59), from_days(60);
+-------------------+--------------+---------------+---------------+
| from_days(730669) | from_days(5) | from_days(59) | from_days(60) |
+-------------------+--------------+---------------+---------------+
| 2000-07-03 | 0000-01-05 | 0000-02-28 | 0000-03-01 |
+-------------------+--------------+---------------+---------------+