This section contains reference documentation for the ToDateTime function.
Last updated 2 years ago
Was this helpful?
Converts from milliseconds to a formatted date-time string, based on the provided .
ToDate(millis, pattern) ToDate(millis, pattern, timezoneId)
ToDate(millis, pattern)
ToDate(millis, pattern, timezoneId)
SELECT ToDateTime(1639137263000, 'yyyy-MM-dd') AS dateTimeString FROM ignoreMe
2021-12-10
SELECT ToDateTime( 1639137263000, 'yyyy-MM-dd hh:mm:ss a' ) AS dateTimeString FROM ignoreMe
2021-12-10 11:54:23 AM
SELECT ToDateTime( 1639137263000, 'yyyy-MM-dd HH:mm:ss Z', 'CET' ) AS dateTimeString FROM ignoreMe
2021-12-10 12:54:23 +0100