Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I need to convert the following string Fri Jun 07 00:00:00 CEST 2019 to another string but with the format 2019-06-07 (yyyy-MM-dd).
Can anyone help, please? I have been trying everything but I can't find a solution!
Thank you in advance
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzzz yyyy"); Date d = sdf.parse("Fri Jun 07 00:00:00 CEST 2019"); sdf.applyPattern("yyyy-MM-dd"); String newDateString = sdf.format(d); //2019-06-07
may be worth putting into a tJavaRow beforehand rather than running all this through a tMap
Thank you very much! It worked for me : )
Another option is to convert using Talend date parsing functions available in tMap as shown in below link.
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