String to Date conversion always gives 20170101

Highlighted
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
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
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

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads