Convert String to Date

One Star

Convert String to Date

Hello,

 

I have a Date "Fri, 28 Dec 2018 12:19:26 +0100"  as a String.

 

I want to convert this string "Fri, 28 Dec 2018 12:19:26 +0100" to Date (dd-MM-yyyy)

 

Thanks a lot for your help.

Seven Stars

Re: Convert String to Date

hello,

 

TalendDate.parseDate("dd MM yyyy",row1.Date_of_birth) 

 

 

Seven Stars

Re: Convert String to Date

Hello Fatouil,

 

use TalendDate.parseDate("EEE, dd MMM yyyy HH:mm:ss Z", row1.yourString) to convert your String to a Date; you can then use TalendDate.formatDate("dd-MM-yyyy", yourDate) to output the Date in the desired format.

 

Best regards,

 

Thomas

 

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