MAKEDATE
MAKEDATE(year, dayofyear)
Section titled “MAKEDATE(year, dayofyear)”- year: This refers to the four-digit year part of a date value in MySQL. Its range is from 1000 to 9999.
- dayofyear: This corresponds to the day of the year, ranging from 1 to 366. It calculates the combined date after taking the specified year and adding the number of days to it.
Example
Section titled “Example”SELECT MAKEDATE(2021, 365);Output
Section titled “Output”'2021-12-31'Explanation
Section titled “Explanation”In the given example, the MAKEDATE function creates a date from the year (2021) and day-of-year (365) values provided to it. Thus, the output is a date (2021-12-31) which corresponds to the 365th day of year 2021.