Created
January 11, 2016 02:01
-
-
Save tfentonz/d14cf1ba647f39b58776 to your computer and use it in GitHub Desktop.
MySQL GET_FORMAT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
NOW() AS 'now', | |
GET_FORMAT(DATE, 'ISO') AS 'format', | |
DATE_FORMAT(NOW(), GET_FORMAT(DATE, 'ISO')) AS 'iso_8601'; | |
+---------------------+----------+------------+ | |
| now | format | iso_8601 | | |
+---------------------+----------+------------+ | |
| 2016-01-11 12:34:56 | %Y-%m-%d | 2016-01-11 | | |
+---------------------+----------+------------+ | |
1 row in set (0.00 sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment