Apache Pinot Docs
Search…
latest
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

1
SELECT ToDateTime(1639137263000, 'YYYY-MM-dd') AS dateTimeString
2
FROM ignoreMe
Copied!
dateTimeString
2021-12-10
1
SELECT ToDateTime(
2
1639137263000,
3
'YYYY-MM-dd hh:mm:ss a'
4
) AS dateTimeString
5
FROM ignoreMe
Copied!
dateTimeString
2021-12-10 11:54:23 AM
1
SELECT ToDateTime(
2
1639137263000,
3
'YYYY-MM-dd HH:mm:ss Z',
4
'CET'
5
) AS dateTimeString
6
FROM ignoreMe
Copied!
dateTimeString
2021-12-10 12:54:23 +0100
Last modified 1mo ago
Copy link