Six Stars

String to Date conversion always gives 20170101

Hi Team,

 

I am trying to convert a string(20170404) to a date of format YYYYMMDD, since my target is a date format.

 

I tried both tmap and tconverttype both gave me 20170101. Please advise what I might be doing wrong!

image.png

image.png

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars TRF
Twelve Stars

Re: String to Date conversion always gives 20170101

Change the date format mask:

TalendDate.parseDate("yyyyMMdd",row1.date_val) 

TRF
1 REPLY
Twelve Stars TRF
Twelve Stars

Re: String to Date conversion always gives 20170101

Change the date format mask:

TalendDate.parseDate("yyyyMMdd",row1.date_val) 

TRF