FORMAT_DATE

This page describes the FORMAT_DATE function in Lenses SQL.

FORMAT_DATE(date,output_pattern)

Returns a string representation of a date value according to a given pattern.

Available in:

ProcessorsSQL Studio

Sample code:

USE `kafka`;
SELECT 
    FORMAT_DATE(_meta.timestamp,'dd-MM-yyyy HH:mm'), 
    _meta.timestamp 
FROM nyc-yellow-taxi-trip
LIMIT 1;

Output:

{
  "value": {
    "FORMAT_DATE": "28-11-2023 20:28",
    "timestamp": "2023-11-28T20:28:45.41Z"
  }
}

Last updated

Logo

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