Skip to content

Latest commit

 

History

History
58 lines (45 loc) · 1.04 KB

fromdatetime.md

File metadata and controls

58 lines (45 loc) · 1.04 KB
description
This section contains reference documentation for the FromDateTime function.

FromDateTime

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

Signature

FromDateTime(dateTimeString, pattern)

Usage Examples

SELECT FromDateTime('2019-08-07', 'yyyy-MM-dd') AS epochMillis
FROM ignoreMe
epochMillis
1565136000000
SELECT FromDateTime(
    '2019-08-07 3:12:13 PM', 
    'yyyy-MM-dd hh:mm:ss a'
    ) AS epochMillis
FROM ignoreMe
epochMillis
1565190733000
SELECT FromDateTime(
    '2019-08-07T15:12:13', 
    'yyyy-MM-dd''T''HH:mm:ss'
    ) AS epochMillis
FROM ignoreMe
epochMillis
1565190733000
SELECT FromDateTime(
    '2019-08-07T07:12:13-0800', 
    'yyyy-MM-dd''T''HH:mm:ssZ'
    ) AS epochMillis
FROM ignoreMe
epochMillis
1565190733000