What is the purpose of the month function in MySQL?

In MySQL, the MONTH() function is used to extract the month part from a date. Its syntax is as follows:

MONTH(date)

The function returns an integer between 1 and 12, indicating the month of the given date expression. For example, for the date ‘2021-09-15’, the MONTH() function will return 9.

广告
Closing in 10 seconds
bannerAds