Collections:
HOUR() - Hours of Time
How to extract the hours from a given time using the HOUR() function?
✍: FYIcenter.com
HOUR(time) is a MySQL built-in function that
returns the hour value from a given time.
For example:
SELECT HOUR(NOW()), NOW(); -- +-------------+---------------------+ -- | HOUR(NOW()) | NOW() | -- +-------------+---------------------+ -- | 22 | 2023-11-14 22:59:16 | -- +-------------+---------------------+
Reference information of the HOUR() function:
HOUR(time): int Returns the hour for time. The range of the return value is 0 to 23 for time-of-day values. Arguments, return value and availability: time: Required. The time to extract the hour from. int: Return value. The hour value. Available since MySQL 4.
Related MySQL functions:
⇒ LAST_DAY() - Last Day of Month
⇐ GET_FORMAT() - Standard Datetime Formats
2023-11-17, 676🔥, 0💬
Popular Posts:
How To Find Out What Privileges a User Currently Has in Oracle? Privileges granted to users are list...
How To View Data Files in the Current Database in Oracle? If you want to get a list of all tablespac...
How to put statements into a statement block in SQL Server Transact-SQL? You can put statements into...
What To Do If the StartDB.bat Failed to Start the XE Instance in Oracle? If StartDB.bat failed to st...
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in SQL Server? Sometimes, y...