웹이야기

MySQL FROM_DAYS() 본문

D/MySQL

MySQL FROM_DAYS()

yeon.Biju 2020. 4. 1. 16:54

MySQL 날짜함수, 시간함수

 

FROM_DAYS()

   - 숫자를 DATE 형태로 return 해준다. 

 

 

FROM_DAYS(N)

 

Given a day number N, returns a DATE value.

 

Use FROM_DAYS() with caution on old dates. It is not intended for use with values that precede the advent of the Gregorian calendar(1582).

 

 

mysql> SELECT FROM_DAYS(100) ;
+----------------+
| FROM_DAYS(100) |
+----------------+
| 0000-00-00     |
+----------------+
1 row in set (0.00 sec)

mysql> SELECT FROM_DAYS(10000) ;
+------------------+
| FROM_DAYS(10000) |
+------------------+
| 0027-05-19       |
+------------------+
1 row in set (0.00 sec)

mysql> SELECT FROM_DAYS(80000) ;
+------------------+
| FROM_DAYS(80000) |
+------------------+
| 0219-01-13       |
+------------------+
1 row in set (0.00 sec)

mysql> SELECT FROM_DAYS(180000) ;
+-------------------+
| FROM_DAYS(180000) |
+-------------------+
| 0492-10-27        |
+-------------------+
1 row in set (0.00 sec)

mysql> SELECT FROM_DAYS(980000) ;
+-------------------+
| FROM_DAYS(980000) |
+-------------------+
| 2683-02-24        |
+-------------------+
1 row in set (0.00 sec)

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

MySQL GET_FORMAT()  (0) 2020.04.02
MySQL FROM_UNIXTIME()  (0) 2020.04.02
MySQL EXTRACT()  (0) 2020.04.01
MySQL DAYOFYEAR()  (0) 2020.04.01
MySQL DAYOFWEEK()  (0) 2020.04.01
Comments