Ask Your Question
0

Unable to parse the date "04/16/20 17:50:20" to "yyyy-MM-dd HH:mm:ss' format

asked 2020-04-30 09:36:04 -0500

Veerat K gravatar image

I am trying to use the field converter but its giving me error; com.streamsets.pipeline.api.base.OnRecordErrorException: CONVERTER_00 - Failed to convert field '/Date' of type 'STRING' with value '04/16/20 17:50:20' to type 'DATETIME'

I even tried using the "time:createDateFromStringTZ" but its giving me null

Please help

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-05-01 21:26:05 -0500

iamontheinet gravatar image

updated 2020-05-01 22:13:37 -0500

Hi!

Use Expressions Evaluator with Field Expression like so, ${time:extractStringFromDate(time:createDateFromStringTZ(record:value('/Date'),'UTC',"MM/dd/yy HH:mm:ss"), "yyyy-MM-dd HH:mm:ss")}.

image description

For valid date and time formats, refer to -- https://docs.oracle.com/javase/8/docs...

For valid time zones, refer to -- https://www.vmware.com/support/develo...

Cheers, Dash

edit flag offensive delete link more
1

answered 2020-05-02 17:13:19 -0500

J3 gravatar image

updated 2020-05-03 15:57:57 -0500

Hi Veerat and Everyone,

I noticed this a common question asked by many newcomers to StreamSets Data Collector, so I created a gist which one can download and import as a pipeline:

Sample gist of how to convert a date string

It's a working example of a couple of ways to convert a date string value into a different value.

Be safe!! J3

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-04-30 09:36:04 -0500

Seen: 194 times

Last updated: May 03