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

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch