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 3, 2018 in Talend by 93.lynn
• 1,590 points

edited Apr 3, 2018 by 93.lynn 1,436 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 3, 2018 by misc.edu04
• 1,430 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
• 6,920 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,640 points
469 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 16, 2018 in Talend by code.reaper12
• 3,450 points
759 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,450 points
1,567 views
0 votes
1 answer

Converting Columns into Rows in Talend

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

answered Apr 10, 2018 in Talend by code.reaper12
• 3,450 points

edited Apr 10, 2018 by code.reaper12 851 views
0 votes
1 answer

Looping through all the schemas in Talend

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

answered Apr 10, 2018 in Talend by code.reaper12
• 3,450 points
135 views
0 votes
1 answer

Parsing JSON in Talend

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

answered Apr 2, 2018 in Talend by code.reaper12
• 3,450 points
589 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer