String to Date conversion always gives 20170101

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


Accepted Solutions
Highlighted
Fifteen Stars TRF
Fifteen Stars

Re: String to Date conversion always gives 20170101

Change the date format mask:

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

TRF

All Replies
Highlighted
Fifteen Stars TRF
Fifteen Stars

Re: String to Date conversion always gives 20170101

Change the date format mask:

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

TRF

What’s New for Talend Spring ’19

Join us live for a sneak peek!

Sign up now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download