TO_ISO8601
Descriptionβ
Converts a datetime value to an ISO8601 formatted string.
Syntaxβ
TO_ISO8601(<dt>)
Parametersβ
Parameter | Description |
---|---|
<dt> | The input datetime value, which can be of type DATETIME or DATE |
Return Valueβ
Returns a value of type VARCHAR, representing the datetime in ISO8601 format.
Exampleβ
SELECT TO_ISO8601('2020-01-01 12:30:45');
+-------------------------------------+
| to_iso8601('2020-01-01 12:30:45.0') |
+-------------------------------------+
| 2020-01-01T12:30:45 |
+-------------------------------------+