Jump to: navigation, search

Mysql HOUR

From w3cyberlearnings

Contents

MySQL HOUR Function

This function returns hours from a given date or timestamp expression.

Syntax HOUR

  • expre: date or timestamp expression
HOUR(expre);

Example 1

mysql> SELECT HOUR('12:03:48');
+------------------+
| HOUR('12:03:48') |
+------------------+
|               12 |
+------------------+
1 row in set (0.00 sec)

Example 2

mysql> SELECT HOUR('2012-05-22 12:03:48');
+-----------------------------+
| HOUR('2012-05-22 12:03:48') |
+-----------------------------+
|                          12 |
+-----------------------------+
1 row in set (0.00 sec)

Related Links



Navigation
Web
SQL
MISC
References