웹이야기

MySQL TIME_FORMAT() 본문

D/MySQL

MySQL TIME_FORMAT()

yeon.Biju 2020. 4. 4. 19:46

MySQL 날짜함수, 시간함수

 

TIME_FORMAT()

   -

 

TIME_FORMAT(time format)

의 형태

 

This is used like the DATE_FORMAT() function, but the format string may contain format specifiers only for hours, minute, seconds, and microseconds. Other specifiers produce a NULL value or 0.

 

It the time value contains an hour part that is greater than 23, the %H and %k hour format specifiers produce a value larger than the usual range of 0..23. The other hour format specifiers produce the hour value modulo 12. 

 


mysql> SELECT TIME_FORMAT('100:00:00', '%h %k %h %I %l');
+--------------------------------------------+
| TIME_FORMAT('100:00:00', '%h %k %h %I %l') |
+--------------------------------------------+
| 04 100 04 04 4                             |
+--------------------------------------------+
1 row in set (0.00 sec)

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

MySQL TO_DAYS()  (0) 2020.04.05
MySQL TIME_TO_SEC()  (0) 2020.04.05
MySQL TIMESTAMPDIFF()  (0) 2020.04.04
MySQL TIMESTAMPADD()  (0) 2020.04.04
MySQL TIMESTAMP()  (0) 2020.04.04
Comments