Convert a String to a Date

Six Stars

Convert a String to a Date

In my Tmap I am trying to map a String value over to a date. My data coming in looks like 2016-09-01T10:53:24. I need to remove the T and keep all other date time info there.

 

I tried to just so a row1.DateTimeModified.replace("T"," ") but that didn't work.

Nine Stars

Re: Convert a String to a Date

Please try below.

 

Scenario3.PNGScenario31.PNG

 

Regards,

Veeru Boppudi
Seven Stars

Re: Convert a String to a Date

Hi shawnm,

convert your modified String to a Date using 

TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", row1.DateTimeModified.replace("T", " "))

 Best regards,

Thomas

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

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