웹이야기

MySQL HOUR() 본문

D/MySQL

MySQL HOUR()

yeon.Biju 2020. 4. 2. 12:53

MySQL 날짜함수, 시간함수

 

HOUR()

- 시간에 대한 시 값을 알려준다. (HOUR)

 

 

HOUR(time)

의 형태

 

Returns the hour for time. The range of return value is 0 to 23 for time-of-day values. Howerer the range of TIME values actually is much larger, so HOUR can return values greater than 23

 

 

mysql> SELECT HOUR(NOW());
+-------------+
| HOUR(NOW()) |
+-------------+
|          12 |
+-------------+
1 row in set (0.00 sec)

mysql> SELECT HOUR('10:05:03');
+------------------+
| HOUR('10:05:03') |
+------------------+
|               10 |
+------------------+
1 row in set (0.00 sec)

mysql> SELECT HOUR('272:05:03');
+-------------------+
| HOUR('272:05:03') |
+-------------------+
|               272 |
+-------------------+
1 row in set (0.00 sec)


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

MySQL LOCALTIME()  (0) 2020.04.02
MySQL LAST_DAY()  (0) 2020.04.02
MySQL GET_FORMAT()  (0) 2020.04.02
MySQL FROM_UNIXTIME()  (0) 2020.04.02
MySQL FROM_DAYS()  (0) 2020.04.01
Comments