Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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 0683p000009MACn.png

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

    If your input data is a String, you can convert to date as shown below

0683p000009M7pG.png

 

0683p000009M7pH.png

 

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

View solution in original post

5 Replies
Anonymous
Not applicable
Author

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?

Anonymous
Not applicable
Author

Hi,

 

    If your input data is a String, you can convert to date as shown below

0683p000009M7pG.png

 

0683p000009M7pH.png

 

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

Anonymous
Not applicable
Author

Dear @nthampi,

 

My issue is resolved. Thank you so much for your help 🙏 🙏 

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

Hi
You just need to change the data pattern of column 'output_date' on tMap to "yyyy-MM-dd HH:mm:ss.SSS"

Regards
Shong