웹이야기

MySQL TIME() 본문

D/MySQL

MySQL TIME()

yeon.Biju 2020. 4. 3. 17:15

MySQL 날짜함수, 시간함수

 

TIME()

   - 시간(time)을 추출

 

TIME(expr)

의 형태

 

Extract the time part of the time or datetime expressioin expr and returns it as a string.

 

This function is unsafe for statement-based replication. A warning is logged if you use this function when binlog_format is set to STATEMENT.

 

mysql> SELECT TIME(NOW());
+-------------+
| TIME(NOW()) |
+-------------+
| 17:13:24    |
+-------------+
1 row in set (0.00 sec)

 

mysql> SELECT  TIME('2020-04-03 13:11:12.99887766');
+--------------------------------------+
| TIME('2020-04-03 13:11:12.99887766') |
+--------------------------------------+
| 13:11:12.998878                      |
+--------------------------------------+
1 row in set (0.00 sec)

 

mysql> SELECT  TIME('2020-04-03 13:11:12');
+-----------------------------+
| TIME('2020-04-03 13:11:12') |
+-----------------------------+
| 13:11:12                    |
+-----------------------------+
1 row in set (0.00 sec)

'D > MySQL' 카테고리의 다른 글

MySQL TIMESTAMP()  (0) 2020.04.04
MySQL TIMEDIFF()  (0) 2020.04.03
MySQL SYSDATE()  (0) 2020.04.03
MySQL SUBTIME()  (0) 2020.04.03
MySQL SUBDATE()  (0) 2020.04.03
Comments