MySQL HOUR() Function

MySQL Functions : Return the hour part of a datetime

Definition and Usage

The HOUR() function returns the hour part for a given date (from 0 to 838).

Syntax

HOUR(datetime)

Parameter Values

Parameter Description
datetime Required. The datetime value to extract the hour from

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Return the hour part of a datetime: 

SELECT HOUR("838:59:59");