FROM_DAYS()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the DATE
for a day number based on the Gregorian calendar.
USAGE
FROM_DAYS(day_num)
Argument Name | Description |
---|---|
| The Gregorian day number |
DETAILS
FROM_DAYS()
is a date-time function that returns a DATE
value from a given a day number on the Gregorian calendar.
The date 0001-01-01
is the Gregorian day 366
. Lower day numbers return the invalid date 0000-00-00
.
The actual start of the Gregorian calendar is day 1582
.
A NULL
is returned if the argument is NULL
.
EXAMPLES
SELECT FROM_DAYS(736000);
+-------------------+
| FROM_DAYS(736000) |
+-------------------+
| 2015-02-06 |
+-------------------+
SELECT FROM_DAYS(366);
+----------------+
| FROM_DAYS(366) |
+----------------+
| 0001-01-01 |
+----------------+