
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to convert Dates to YYYYMMDD" format
Hi,
I would like to get some help on the issue I am trying to fix.
I am using the tMap component and trying to convert the date value of a column from "yyyy-MM-dd'T'HH:mm:ss'.000Z'" to "yyyymmdd" date format. I tried to use the syntax below but it won't work.
TalendDate.formatDate("yyyymmdd",row1.DateStamp)
I even changed the Data Type to String in the tMap Output still it won't work.
If I forced the required format ("yyyymmdd") in the "Date Pattern" field in tMap it was giving me an incorrect value such as "20213912" instead of "20220612".
Do you have any idea on this how to fix it?
Thank you much in advance.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Mitz,
Regarding to your above error, seems the input column type is 'Date'? if yes, please setup the tMap output value to row1.DateStamp as the below

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
in the tMap output, you can setup the column value to TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",row1.DateStamp ) , the column type to 'Date' with Date pattern: "yyyyMMdd" as the below

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much, Achen.
I tried to apply your solution but, I got the error below.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Mitz,
Regarding to your above error, seems the input column type is 'Date'? if yes, please setup the tMap output value to row1.DateStamp as the below

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Achen.
It works now. Thanks for your help. 👍
