Obtain the current hour, minute, and second by passing CURTIME() or NOW( ) to a time-component function
mysql>
mysql> SELECT NOW( ), HOUR(NOW( )) AS hour,
-> MINUTE(NOW( )) AS minute, SECOND(NOW( )) AS second;
+---------------------+------+--------+--------+
| NOW( ) | hour | minute | second |
+---------------------+------+--------+--------+
| 2011-10-03 13:05:45 | 13 | 5 | 45 |
+---------------------+------+--------+--------+
1 row in set (0.00 sec)
mysql>
mysql>
Related examples in the same category