
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Convert date to YYYY-MM-dd..
Hi All.
How to convert Tue Oct 15 00:00:00 SGT 2019 to YYYY-MM-dd format? Thanks in advance
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If your input data is a String, you can convert to date as shown below
Relational.ISNULL(row1.input_date)?null:TalendDate.parseDate("E MMM dd HH:mm:ss Z yyyy",row1.input_date)
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This depends on what you are doing. If your column is a Date object and you are printing out to the terminal or to a flat file, then you just need to deal with the format on the schema. If you are have a String representation of a date coming in and want to change it, you will need to parse it as a date and then format the output. What exactly are you trying to do here?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If your input data is a String, you can convert to date as shown below
Relational.ISNULL(row1.input_date)?null:TalendDate.parseDate("E MMM dd HH:mm:ss Z yyyy",row1.input_date)
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear @nthampi ,
Is it possible if I want to convert from "Tue Oct 15 00:00:00 SGT 2019" to YYYY-MM-DD hh:mm:ss.sss format? Kindly advice. Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You just need to change the data pattern of column 'output_date' on tMap to "yyyy-MM-dd HH:mm:ss.SSS"
Regards
Shong
