Question

converting timestamp to dd/mm/yyyy format through streamsets

  • 17 February 2022
  • 3 replies
  • 929 views

we are ingesting data from oracle and it has timestamp format as mm/dd/yyyy hh🇲🇲ss AM/PM, while ingesting through streamsets its taking as yyyy-mm-dd hh🇲🇲ss. 

how to change the timestamp format to source format which is mm/dd/yyyy hh🇲🇲ss AM/PM in streamsets


3 replies

reformatting the question : converting timestamp to mm/dd/yyyy hh:mm:ss AM/PM format through streamsets

Userlevel 3
Badge +1

@harshith I have not tried datetime data from oracle before to understand why it is changing. But for this case, you would want to try using ‘Expression Evaluator’ to get the required formatted datetime as string and then use field type converter to change it to the target data type. 

 

 

Refer to the supported functions and its examples here https://docs.streamsets.com/portal/datacollector/latest/help/datacollector/UserGuide/Expression_Language/Functions.html?hl=extractstringfromdate.  Hope this helps.

Userlevel 3
Badge +1

In fact you can also try directly covert the field to datetime and required format without an expression evaluator. Try as below and let us know if it works.

 

 

Reply