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, 983🔥, 0💬
Popular Posts:
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
Is SQL Server Transact-SQL case sensitive? No. Transact-SQL is not case sensitive. Like the standard...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...
How To Select All Columns of All Rows from a Table with a SELECT statement in SQL Server? The simple...