Ask Your Question

How to convert string to DateTime correctly using Field Type Converter?

asked 2019-04-21 21:33:10 -0500

ambarishnag gravatar image


I am trying to convert input string data to output DATETIME data in StreamSets using Field Type Converter.

I am using

Date Format: Other

Other Date Format: MMddyyyy HH:mm:ss

When I run the preview,

the string 01312019 00:00:00 gets converted to datetime Jan 31, 2019 1:00:00 AM and not Jan 31, 2019 12:00:00 AM

What is the reason behind this discrepancy and how can this be avoided ?

Thanks in advance for your help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-04-21 22:00:35 -0500

metadaddy gravatar image

The Field Type Converter uses the machine's locale when it does date/time conversions. You can get more control by using the Expression Evaluator with time:extractStringFromDateTZ.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-04-21 21:33:10 -0500

Seen: 2,334 times

Last updated: Apr 21 '19