From Thursday, July, 9, 3:00 PM Pacific,
our Community site will be in
read-only mode
through Sunday, July 12th.
Thank you for your patience.

Convert a String to a Date

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

Highlighted
Nine Stars

Re: Convert a String to a Date

Please try below.

 

Scenario3.PNGScenario31.PNG

 

Regards,

Veeru Boppudi
Eight 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

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog