Changing date type

Highlighted
Nine Stars

Changing date type

Hello All

Can anyone help for this below requirement , am getting unpareble date when am passing through tMap

I do i have a date format in MM/dd/yyyy and i need to change that date format into yyyy-MM-dd

 

example 

10/05/2019 to 2019-10-05

 

Thanks

Manish

 

 

Nine Stars

Re: Changing date type

Example

 

Input  

05/10/2019 

 

and in

output 

2019-10-05

 

i used  function but it did not worked to me

 

TalendDate.parseDate("MM/dd/yyyy",TalendDate.formatDate("yyyy-dd-MM" row1.Date ))

Six Stars

Re: Changing date type

Hi @manishchokkaram  try like this it worked for me. I tested and it worked for me.

TalendDate.formatDate( "yyyy-MM-dd",row2.dt)

Capture.PNG

 

Output is like below:

Capture.PNG

 

 

I added other date formats just in case if someone needs it.Happy to help.

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog