웹이야기

MySQL WEEKDAY() 본문

D/MySQL

MySQL WEEKDAY()

yeon.Biju 2020. 4. 5. 13:30

MySQL 날짜함수, 시간함수

 

WEEKDAY()

   -

 

WEEKDAY([date])

의 형태

 

Returns the weekday index for date(0=Monday, 1=Tuesday, ... 6=Sunday)

 

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

mysql> SELECT WEEKDAY('2020-04-16');
+-----------------------+
| WEEKDAY('2020-04-16') |
+-----------------------+
|                     3 |
+-----------------------+
1 row in set (0.00 sec)

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

MySQL YEAR()  (0) 2020.04.05
MySQL WEEKOFYEAR()  (0) 2020.04.05
MySQL WEEK()  (0) 2020.04.05
MySQL UTC_TIMESTAMP()  (0) 2020.04.05
MySQL UTC_TIME()  (0) 2020.04.05
Comments