MAKEDATE()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns a date constructed from the year and day-of-year arguments.
USAGE
MAKEDATE(year, dayofyear)
Argument Name | Description |
---|---|
| The numeric year |
| The day number in the year |
DETAILS
MAKEDATE()
is a date-time function that returns a date constructed from a numeric year and day number within the year.
The day-of-year value ranges from 1 to 365 or 366 depending on the year.
The return value is in the YYYY-MM-DD
format when used in string context.
The return value is in the YYYYMMDD
format when used in numeric context.
A NULL
is returned if any argument is NULL
.
EXAMPLES
SELECT MAKEDATE(2020, 15) AS '2020,15',
MAKEDATE(2019, 33) AS '2019,33',
MAKEDATE(2021, 300) AS '2021,300',
MAKEDATE(2019, 0) AS '2019,0';
+------------+------------+------------+--------+
| 2020,15 | 2019,33 | 2021,300 | 2019,0 |
+------------+------------+------------+--------+
| 2020-01-15 | 2019-02-02 | 2021-10-27 | NULL |
+------------+------------+------------+--------+