Eight Stars

Date Issue

I am getting date as 1/1/1800 from the input excel. Type is String. How to pass this value to destination Database. 

 

I received an error that its "Unparseable date" Please suggest

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Seven Stars

Re: Date Issue

hi @samisyed80 

try giving if condition based on the date format inside tmap and check whether it is working or not 

5 REPLIES
Seven Stars

Re: Date Issue

Hi @samisyed80

 

If 1/1/1800 is of the format M/d/yyyy then parse it as TalendDate.parseDate("M/d/yyyy",row1.date) in the target while parsing from the excel .Please make change in the parsedate function based on the format in the source.

 

 

Eight Stars

Re: Date Issue

Hi Rengen,

 

I am already having this code for other proper date's from the input. Only 3 rows are having this 1/1/1800 (m/d/yyyy). Please suggest how to handle this now

 

("".equals(row1.Date) || row1.Date == null ? null : TalendDate.parseDateLocale("EEE MMM dd HH:mm:ss zzz yyyy",row1.Date,"EN"))

Tags (1)
Highlighted
Seven Stars

Re: Date Issue

hi @samisyed80 

try giving if condition based on the date format inside tmap and check whether it is working or not 

Eight Stars

Re: Date Issue

Thanks rengan its resolved

Seven Stars

Re: Date Issue

Thanks for the update