ToDateTime

This section contains reference documentation for the ToDateTime function.

Converts from milliseconds to a formatted date-time string, based on the provided Joda-Time pattern.

Signature

ToDate(millis, pattern)

ToDate(millis, pattern, timezoneId)

Usage Examples

SELECT ToDateTime(1639137263000, 'yyyy-MM-dd') AS dateTimeString
FROM ignoreMe
SELECT ToDateTime(
    1639137263000, 
    'yyyy-MM-dd hh:mm:ss a'
    ) AS dateTimeString
FROM ignoreMe
SELECT ToDateTime(
    1639137263000, 
    'yyyy-MM-dd HH:mm:ss Z',
    'CET'
    ) AS dateTimeString
FROM ignoreMe