MySQL Tutorial/Date Time Functions/CURTIME

Материал из SQL эксперт
Перейти к: навигация, поиск

CURTIME() returns the current time as a value in "HH:MM:SS" or HHMMSS format, depending on whether the function is used in a string or numeric context

CURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().



mysql>d
mysql> SELECT CURTIME();
+-----------+
| CURTIME() |
+-----------+
| 19:46:02  |
+-----------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT CURTIME() + 0;
+---------------+
| CURTIME() + 0 |
+---------------+
| 194602.000000 |
+---------------+
1 row in set (0.00 sec)
mysql>
mysql>
mysql> select CURRENT_TIME();
+----------------+
| CURRENT_TIME() |
+----------------+
| 19:46:02       |
+----------------+
1 row in set (0.00 sec)
mysql>
mysql>
mysql>
mysql>


Using CURTIME() function

mysql>
mysql> select CURTIME();
+-----------+
| CURTIME() |
+-----------+
| 13:54:27  |
+-----------+
1 row in set (0.00 sec)