Home »
MySQL »
MySQL date/time Functions
MySQL MAKEDATE() Function
MySQL | MAKEDATE() Function: Learn about the MAKEDATE() function, how it works, its usages, syntax, and examples.
Submitted by Apurva Mathur, on October 08, 2022
MAKEDATE() Function
The MAKEDATE() function helps us to make a date from the year and number of days. Isn't this unique? You only have to provide the year and number of days and this function will tell you the date.
MAKEDATE() Syntax
SELECT MAKEDATE('year','days');
MAKEDATE() Parameter(s)
- year: The first parameter belongs to the year. You have to provide the year in which you want to make a date. Do remember that the year should contain 4 digits 2001,1765,1987 etc.
- days: The second parameter here denotes the number of days. You have to provide a number that should be greater than 0, and according to the year and days that you have provided this function will tell you the date.
MAKEDATE() Return Value
After taking two parameters it will display the date. If the parameters are not valid then in such case it will display NULL.
MySQL MAKEDATE() Function Example 1
SELECT MAKEDATE('1998',67);
MySQL MAKEDATE() Function Example 2
SELECT MAKEDATE('2009',367);
MySQL MAKEDATE() Function Example 3
SELECT MAKEDATE('2020',256);