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, 240🔥, 0💬
Popular Posts:
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you e...
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...
What Is "mysqld" in MySQL? "mysqld" is MySQL server daemon program which runs quietly in background ...
How To Convert a Unicode Strings to Non-Unicode Strings in SQL Server Transact-SQL? Since Unicode ch...
How To Calculate Age in Days, Hours and Minutes in SQL Server Transact-SQL? On many Web sites, news ...