FORMAT_TIME

This page describes the FORMAT_TIME function in Lenses SQL.

FORMAT_TIME(time, output_pattern)

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

Available in:

ProcessorsSQL Studio

Sample code:

USE `kafka`;
SELECT 
    FORMAT_TIME(_meta.timestamp,'K:mm a, z'), 
    _meta.timestamp 
FROM nyc-yellow-taxi-trip
LIMIT 1;

Output:

{
  "value": {
    "FORMAT_TIME": "8:28 PM, UTC",
    "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.