Retrieve the month component from a given date.
SELECT MONTH(“2017-06-15”); |
The MONTH() function retrieves the month component from a given date, represented as a number from 1 to 12.
MONTH(date) |
Parameter |
Description |
date |
Mandatory: The date or datetime value from which to extract the month. |
Works in: |
From MySQL version 4.0 |
Retrieve the month component from a specified date.
SELECT MONTH(“2017-06-15 09:34:21”); |
Retrieve the month component from the current system date.
SELECT MONTH(CURDATE()); |