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

Eight Stars

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

How to convert date in format of Mon dd hh:mi:ss UTC YYYY 

example 

the value 2018-12-31 15:21:01.0   should be as Mon Dec 31 15:21:01 UTC 2018

Community Manager

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.

 

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

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

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch