How to convert date in format of Mon dd hh:mi:ss UTC YYYY
the value 2018-12-31 15:21:01.0 should be as Mon Dec 31 15:21:01 UTC 2018
This very much depends upon how the data is received. Is it received as a String in the format you have specified or is it received as a Date object? If it is received as a Date object, you simply need to use the routines.TalendDate.formatDateInUTC(pattern, date) method. This will format the date as a String using standard Java date formatting rules (https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html). If the date is received as a String, you will need to parse that String correctly to a Date object (using the
routines.TalendDate.parseDateInUTC(pattern, stringDate) method) and then using the method above (formatDateInUTC) to output it in the format you require.
I've not given you the full answer as I believe there is A LOT of value in figuring out the details yourself. However, I have given you EVERYTHING you NEED to solve this. Good luck.
Watch the recorded webinar!
Accelerate your data lake projects with an agile approach
Create systems and workflow to manage clean data ingestion and data transformation.
Introduction to Talend Open Studio for Data Integration.