Parsing a date with possible single-digit month day year hour by using java text SimpleDateFormat

0 votes

I am creating a project in Talend Open Studio for Data Integration, in which I am getting an error while parsing the dates from the data source. The date is of “String” data type in the following format: 3/14/1967 0:00:00.

As per my research, I can see Talend is using java.text.SimpleDateFormat. I think SimpleDateFormat package handle the single-or-double digit problem. So, I am using “d-M-yyyy H:mm:ss” but still it gives me the following error: Unparsable date: 9/18/1994 0:00:00.

Can you suggest any solution for this or do I need to use a different date pattern?

Apr 4, 2018 in Talend by 93.lynn
• 1,600 points

edited Apr 4, 2018 by 93.lynn 8,083 views

2 answers to this question.

0 votes

If you look at your code, you can pretty much easily deduce the reason for your error. To put it simply, your input date pattern is “3/14/1947” i.e “M/d/yyyy” while the one you are using to specify it is “d-M-yyyy”. Moreover, for the separator, you are using is a hyphen (-) instead of a front slash (/).

answered Apr 4, 2018 by misc.edu04
• 1,450 points
0 votes

Try using M/d/yyyy format.

You might be using the format wrong because i have never faced this error.

answered Aug 3, 2018 by Nilesh
• 7,060 points

Related Questions In Talend

0 votes
1 answer
0 votes
1 answer

Using Java Classes in Talend

While working with routines, the very 1st ...READ MORE

answered Apr 14, 2018 in Talend by geek.erkami
• 2,680 points
2,726 views
0 votes
1 answer

How to load a set of files into database using Talend

Using tFileList component,  you can read all the files present ...READ MORE

answered Apr 17, 2018 in Talend by code.reaper12
• 3,500 points
6,168 views
0 votes
1 answer

How to generate multiple rows from a single row in Talend?

I think using tJavaFlex, tMap and tFlowToIterate ...READ MORE

answered Apr 18, 2018 in Talend by code.reaper12
• 3,500 points
7,816 views
0 votes
1 answer

Converting Columns into Rows in Talend

Hi, You can try using tNormalize component along ...READ MORE

answered Apr 11, 2018 in Talend by code.reaper12
• 3,500 points

edited Apr 11, 2018 by code.reaper12 6,530 views
0 votes
1 answer

Looping through all the schemas in Talend

It is really simple to make tOracleInput ...READ MORE

answered Apr 11, 2018 in Talend by code.reaper12
• 3,500 points
1,898 views
0 votes
1 answer

Parsing JSON in Talend

While working with JSON files, one thing ...READ MORE

answered Apr 3, 2018 in Talend by code.reaper12
• 3,500 points
4,094 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP