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, 1346🔥, 0💬
Popular Posts:
How to detect the collation coercibility associated to a given character string using the COERCIBILI...
How to download and install Microsoft .NET Framework Version 2.0 in SQL Server? .NET Framework Versi...
How To Install Oracle Database 10g XE in Oracle? To install 10g universal edition, double click, Ora...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...