Skip to content

DAY

  • date: The input parameter which specifies the date from which the day will be extracted. It should be in a format that MySQL can recognize, such as ‘YYYY-MM-DD’ or ‘YY-MM-DD’.
SELECT DAY('2021-09-12');
12

In the above query, the DAY() function is used. It extracts the day from the date ‘2021-09-12’. The output of this query is ‘12’, because ‘12’ is the day part of the date ‘2021-09-12’.