웹이야기

MySQL SEC_TO_TIME() 본문

D/MySQL

MySQL SEC_TO_TIME()

yeon.Biju 2020. 4. 3. 09:35

MySQL 날짜함수, 시간함수

 

SEC_TO_TIME()

   - 초를 시간으로 변환

 

SEC_TO_TIME(seconds)

의 형태

 

Returns the seconds argument, converted to hours, minutes, and seconds, as a TIME value. The range of the result is constrained to that of the TIME data type. A warning occurs if the argument corresponds to a value outside that range.

 

 

mysql> SELECT SEC_TO_TIME(2378);
+-------------------+
| SEC_TO_TIME(2378) |
+-------------------+
| 00:39:38          |
+-------------------+
1 row in set (0.00 sec)

mysql> SELECT SEC_TO_TIME(2378)+0;
+---------------------+
| SEC_TO_TIME(2378)+0 |
+---------------------+
|                3938 |
+---------------------+
1 row in set (0.00 sec)

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

MySQL SUBDATE()  (0) 2020.04.03
MySQL STR_TO_DATE()  (0) 2020.04.03
MySQL SECOND()  (0) 2020.04.03
MySQL QUARTER()  (0) 2020.04.02
MySQL PERIOD_DIFF()  (0) 2020.04.02
Comments