timestamp format "Mon dd hh:mi:ss UTC YYYY"

Seven Stars

timestamp format "Mon dd hh:mi:ss UTC YYYY"

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

Sixteen Stars

Re: timestamp format "Mon dd hh:mi:ss UTC YYYY"

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.



Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.