Skip to main content

How to convert a UTC time to a date object?

  • December 20, 2021
  • 0 replies
  • 459 views

AkshayJadhav
StreamSets Employee
Forum|alt.badge.img

Question:

How to convert a UTC time to a date object?

 

Answer:

Here are the two ways to convert UTC time to data object: 1. Using Field Type converter 2. Using EL expression with Expression Evaluator processor.

1. The link for documentation for Field Type Converter:
https://streamsets.com/documentation/datacollector/latest/help/datacollector/UserGuide/Processors/FieldTypeConverter.html?hl=unix%2Ctime%2Cdate%2Cconvert

2.  For EL expressions for processing dates and times, here is the link:
https://streamsets.com/documentation/datacollector/latest/help/datacollector/UserGuide/Expression_Language/Functions.html#concept_qkr_trf_sw

The user can use the Expression Evaluator processor with EL expression, for example: ${time:extractStringFromDateTZ(time:millisecondsToDateTime(record:value('/text')), "GMT", "yyyy.MM.dd")}.

Did this topic help you find an answer to your question?
This topic has been closed for comments