Five 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

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Nine Stars TRF
Nine Stars

Re: String to Date conversion always gives 20170101

Change the date format mask:

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

TRF
1 REPLY
Nine Stars TRF
Nine Stars

Re: String to Date conversion always gives 20170101

Change the date format mask:

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

TRF