Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
I am getting date value from previous module as : Mon Jan 28 09:58:53 IST 2019
but i need to convert this date in tjavaFlex like this ....2019-01-28 09:58:53...How to achieve this ..
Hi,
Please refer the snippet below. I have marked both input and output values as String but if needed, you can type cast it further based on your need.
The code snippet for conversion is as below.
TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",TalendDate.parseDate("E MMM dd HH:mm:ss z yyyy",row1.input_date))
Please spend a second to mark the topic as resolved. Kudos are also welcome 🙂
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 🙂
Hi,
You can use the Parse and format components of tMap to do the modification of date from one format to another.
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 🙂
Hi,
I'd also suggest using the TalendDate.isDate() function as well in conjunction with TalendDate.parseDate, to ensure the date is always in the expected format.
I tried with tmap but getting below error.
Hi,
Please refer the snippet below. I have marked both input and output values as String but if needed, you can type cast it further based on your need.
The code snippet for conversion is as below.
TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",TalendDate.parseDate("E MMM dd HH:mm:ss z yyyy",row1.input_date))
Please spend a second to mark the topic as resolved. Kudos are also welcome 🙂
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 🙂