Collections:
MONTH() - Month of Year
How to extract the month of year from a given date using the MONTH() function?
✍: FYIcenter.com
MONTH(date) is a MySQL built-in function that
returns the month of year from a given date.
For example:
SELECT MONTH('2023-02-03'), MONTH(NOW()), NOW();
-- +---------------------+--------------+---------------------+
-- | MONTH('2023-02-03') | MONTH(NOW()) | NOW() |
-- +---------------------+--------------+---------------------+
-- | 2 | 11 | 2023-11-15 08:19:34 |
-- +---------------------+--------------+---------------------+
Reference information of the MONTH() function:
MONTH(date): int Returns the month for date, in the range 1 to 12 for January to December, or 0 for dates such as '0000-00-00' or '2008-00-00' that have a zero month part. Arguments, return value and availability: date: Required. The date to extract the month of year from. int: Return value. The month of year. Available since MySQL 4.
Related MySQL functions:
2023-11-17, 1186🔥, 0💬
Popular Posts:
What Is an Oracle Instance in Oracle? Every running Oracle database is associated with an Oracle ins...
How to convert a JSON (JavaScript Object Notation) quoted string into a regular character string usi...
How To Look at the Current SQL*Plus System Settings in Oracle? If you want to see the current values...
How To Revise and Re-Run the Last SQL Command in Oracle? If executed a long SQL statement, found a m...
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns...