웹이야기

MySQL GET_FORMAT() 본문

D/MySQL

MySQL GET_FORMAT()

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

MySQL 날짜함수, 시간함수

 

GET_FORMAT()

   - 

 

GET_FORMAT({ DATE | TIME | DATETIME }, { 'EUR' | 'USA' | 'JSI' | 'ISO' | 'INTERVAL'})

 

Returns a format string. This function useful in combination with the DATE_FOMRAT() and the STR_TO_DATE() functions.

 

The possible values for the first and second arguments result in serveral possible format strings. ISO format refers to ISO 9075, not ISO 8601

 

 

흠.. 나머진 생략

 

 

mysql> SELECT DATE_FORMAT('203-10-03', GET_FORMAT(DATE, 'EUR'));

+---------------------------------------------------+
| DATE_FORMAT('203-10-03', GET_FORMAT(DATE, 'EUR')) |
+---------------------------------------------------+
| 03.10.0203                                        |
+---------------------------------------------------+
1 row in set (0.00 sec)

 

 

mysql> SELECT STR_TO_DATE('10.31.2003', GET_FORMAT(DATE, 'USA'));
+----------------------------------------------------+
| STR_TO_DATE('10.31.2003', GET_FORMAT(DATE, 'USA')) |
+----------------------------------------------------+
| 2003-10-31                                         |
+----------------------------------------------------+
1 row in set (0.00 sec)

 

 

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

MySQL LAST_DAY()  (0) 2020.04.02
MySQL HOUR()  (0) 2020.04.02
MySQL FROM_UNIXTIME()  (0) 2020.04.02
MySQL FROM_DAYS()  (0) 2020.04.01
MySQL EXTRACT()  (0) 2020.04.01
Comments