Collections:
LAST_DAY() - Last Day of Month
How to convert a date to the month-end date using the LAST_DAY() function?
✍: FYIcenter.com
LAST_DAY(date) is a MySQL built-in function that
returns the month-end date from a given date.
For example:
SELECT LAST_DAY('2020-02-14'), LAST_DAY(NOW()), NOW();
-- +------------------------+-----------------+---------------------+
-- | LAST_DAY('2020-02-14') | LAST_DAY(NOW()) | NOW() |
-- +------------------------+-----------------+---------------------+
-- | 2020-02-29 | 2023-11-30 | 2023-11-15 08:33:35 |
-- +------------------------+-----------------+---------------------+
Reference information of the LAST_DAY() function:
LAST_DAY(date): dt Takes a date or datetime value and returns the corresponding value for the last day of the month. Returns NULL if the argument is invalid. Arguments, return value and availability: date: Required. The date to be converted from. dt: Return value. The month-end date. Available since MySQL 4.
⇒ LOCALTIME() - Synonym for NOW()
2023-11-17, 1437🔥, 0💬
Popular Posts:
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...
What Are the Differences between BINARY and VARBINARY in MySQL? Both BINARY and VARBINARY are both b...
How to check if two JSON values have overlaps using the JSON_OVERLAPS() function? JSON_OVERLAPS(json...
How To Download Oracle Database 10g XE in Oracle? If you want to download a copy of Oracle Database ...
Can You Drop an Index Associated with a Unique or Primary Key Constraint in Oracle? You can not dele...