TO_DATETIME

This page describes the TO_DATETIME function in Lenses SQL.

TO_DATETIME(strExpr, pattern)

Converts a string representation of a datetime into epoch value using the pattern provided.

Available in:

ProcessorsSQL Studio

Sample code:

USE `kafka`;
SELECT 
    TO_DATETIME(tpep_dropoff_datetime, 'yyyy-MM-dd HH:mm:ss'), 
    tpep_dropoff_datetime 
FROM nyc-yellow-taxi-trip
LIMIT 1;

Output:

{
  "value": {
    "TO_DATETIME": "2016-01-01T00:11:14Z",
    "tpep_dropoff_datetime": "2016-01-01 00:11:14"
  }
}

Last updated

Logo

2024 © Lenses.io Ltd. Apache, Apache Kafka, Kafka and associated open source project names are trademarks of the Apache Software Foundation.