This pipeline demonstrates how to convert dates from string to various datetime formats and timezones using Field Type Converter and Expression Evaluator processors.
- Download the pipeline and import it into your Data Collector
The pipeline has been prepopulated with sample dates in string format.
Click on Preview icon to see how the data is being transformed as it is flowing through various stages in the pipeline. For details on data preview, refer to the documentation.
Field Type Converter
Using Field Type Converter dates in columns date1, date2, and date3 are converted to datetime using formats EEE MMM dd HH:mm:ss Z yyyy, EEE MMM dd HH:mm:ss, and yyyy-MM-dd HH:mm:ss.SSSSSS respectively.
Expression Evaluator
Using Expression Evaluator dates in columns date3, date4, date5 and date6 are converted to datetime in various timezones using expressions ${time:extractStringFromDateTZ(record:value('/date3'), 'GMT','MMM d, yyyy HH:mm:ss')}, ${time:createDateFromStringTZ(record:value('/date4'), 'CST','yyyy-MM-dd HH:mm:ss.SSSSSS')}, ${time:createDateFromStringTZ(record:value('/date5'), 'CST','dd-MMM-yy HH.mm.ss.SSSSSS a z')}, and ${time:createDateFromStringTZ(record:value('/date6'), 'EST','dd-MMM-yy HH.mm.ss.SSSSSSSSS a z')} respectively.