Skip to main content
Question

converting timestamp to dd/mm/yyyy format through streamsets

  • February 17, 2022
  • 3 replies
  • 1124 views

harshith
Discovered Fame

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

harshith
Discovered Fame
  • Author
  • Discovered Fame
  • 11 replies
  • February 17, 2022

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


Pradeep
StreamSets Employee
Forum|alt.badge.img+1
  • StreamSets Employee
  • 48 replies
  • February 17, 2022

@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.


Pradeep
StreamSets Employee
Forum|alt.badge.img+1
  • StreamSets Employee
  • 48 replies
  • February 18, 2022

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