웹이야기

MySQL ADDTIME() 본문

D/MySQL

MySQL ADDTIME()

yeon.Biju 2020. 4. 1. 10:45

MySQL 날짜함수, 시간함수

 

ADDTIME()

 

ADDTIME(expr1, expr2)

의 형태

 

ADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time or datetime expression, and expr2 is a time expression.

 

mysql> SELECT ADDTIME('2007-12-31 23;59;59.999999', '1 1:1:1.000002');
+---------------------------------------------------------+
| ADDTIME('2007-12-31 23;59;59.999999', '1 1:1:1.000002') |
+---------------------------------------------------------+
| 2008-01-02 01:01:01.000001                              |
+---------------------------------------------------------+
1 row in set (0.00 sec)

 


mysql> SELECT ADDTIME('01:00:00.999999', '02:00:00.999998');
+-----------------------------------------------+
| ADDTIME('01:00:00.999999', '02:00:00.999998') |
+-----------------------------------------------+
| 03:00:01.999997                               |
+-----------------------------------------------+
1 row in set (0.00 sec)

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

MySQL CURDATE()  (0) 2020.04.01
MySQL CONVERT_TZ()  (0) 2020.04.01
MySQL ADDDATE()  (0) 2020.04.01
MySQL Date and Time Functions  (0) 2020.03.31
MySQL TRUNCATE()  (0) 2020.03.29
Comments