In MySQL, you can use the GET_FORMAT() function to return a format string for the provided arguments. This can be useful when you need to provide a format string to another function, such as DATE_FORMAT() or STR_TO_DATE().
MySQL
EXTRACT() Examples – MySQL
In MySQL, you can use the EXTRACT() function to extract parts from a date. For example, you can extract the year part, the month part, or the day part, etc. You can also extract parts from the time component, such as minutes, seconds, microseconds, etc.
This article contains examples to demonstrate.
DAY() Examples – MySQL
In MySQL, the DAY() function is a synonym for the DAYOFMONTH() function. It’s used to return the day of the month from a date.
In this context the “day of the month” is a value between 1 and 31, or 0 for dates with a zero day part. For example, if you provide a date of 2020-05-03, the DAY() function will return 3.