String to Date Conversion and back to String

Highlighted
Six Stars

String to Date Conversion and back to String

Hi,

 

I am having a strange problem. My source is a Excel file which has a date field. I read the date field as string as it in 1-Jan-2017 format. Using tMap I convert it into Date and change it to  01-01-2016. Now when I again convert it back to string using tConvertType the month changes to 00. So irrespective of the date the month is defaulted to 00.

 

How do I overcome this issue ?

Highlighted
Eight Stars

Re: String to Date Conversion and back to String

HI,
Use Formatdate and parsedate together. It will solve your problem. Just check some old resolved topics of Old Talend Community. U will be able to do it

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