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, 1456🔥, 0💬
Popular Posts:
How to obtain the number of rows found by the last SELECT statement using the FOUND_ROWS() function?...
What Privilege Is Needed for a User to Delete Rows from Tables in Another Schema in Oracle? For a us...
What Is Transport Network Substrate (TNS) in Oracle? TNS, Transport Network Substrate, is a foundati...
How To Get the Definition of a View Out of the SQL Server in SQL Server? If you want get the definit...
How To Concatenate Two Character Strings Together in SQL Server Transact-SQL? Concatenating two char...