일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 티베로
- String Function and Operators
- 방화벽
- 오라클
- 윈도우
- SVN
- String Functions and Date Operators
- MySQL
- String Functions and Operators
- Tibero
- HTTP
- 전자정부 표준프레임워크
- Data and Time Functions
- Date and Time Function
- Sring Functions and Operators
- Oracle
- 전자정부표준프레임워크
- Date and Time Functions
- Today
- Total
웹이야기
MySQL TO_DAYS() 본문
MySQL 날짜함수, 시간함수
TO_DAYS()
-
TO_DAYS(date)
의 형태
Given a date date, returns a day number(the number of days since year 0)
TO_DAYS() is not intended for use with values that precede the advent of the Gregorian calendar(1582), because it does not take into account the days that were lost when the calendar was changed. For dates before 1582(and possibly a later year in other locales), results from this function are not reliable.
Remember that MySQL converts two-digit year values in dates to four-digit form using the rules ...
mysql> SELECT TO_DAYS(950501);
+-----------------+
| TO_DAYS(950501) |
+-----------------+
| 728779 |
+-----------------+
1 row in set (0.00 sec)
mysql> SELECT TO_DAYS(NOW());
+----------------+
| TO_DAYS(NOW()) |
+----------------+
| 737885 |
+----------------+
1 row in set (0.00 sec)
mysql> SELECT TO_DAYS('2020-04-01');
+-----------------------+
| TO_DAYS('2020-04-01') |
+-----------------------+
| 737881 |
+-----------------------+
1 row in set (0.00 sec)
'D > MySQL' 카테고리의 다른 글
MySQL UNIX_TIMESTAMP() (0) | 2020.04.05 |
---|---|
MySQL TO_SECONDS() (0) | 2020.04.05 |
MySQL TIME_TO_SEC() (0) | 2020.04.05 |
MySQL TIME_FORMAT() (0) | 2020.04.04 |
MySQL TIMESTAMPDIFF() (0) | 2020.04.04 |