timestamp format

Five Stars

timestamp format

Hello everyone,

 

I'm using talend open studio data integration and new to this tool.

I have a csv file that has timestamp column and i'm trying to convert this in the schema of the input delimted_file. and I get the below error.

 

Couldn't parse value for column 'Tx_Timestamp' in 'row1', value is '07-JUL-18 05.17.36.000 PM -05:00'. Details: java.lang.RuntimeException: Unparseable date: "07-JUL-18 05.17.36.000 PM -05:00"

 

I tried this various options like "dd-MMM-yy HH.ms.ss.SSS a  Z" but nothing helped.

 

Please let me know.

 

 

Nine Stars

Re: timestamp format

Are you looking for the following output?

 

 DateFormat1.PNG

Regards,

Veeru Boppudi
Five Stars

Re: timestamp format

Yes this is exactly the output I need . so I need to us this following below to convert it?

 

TalendDate.ParseDateinUTC ( )

 

and I won't be able to use this in the FileInput_Delimted . under edit schema? Correct?

 

I can use it in tmap in expression editor and use that as a separate column/variable?

 

Thanks!

Five Stars

Re: timestamp format

Hi bro!

When I have to convert a TimeStamp field to a DateTime field, I like to create a routine in Talend for these purpose, and I'm going to show you how with a simple example where I've got a .csv input with a TimeStamp in milliseconds connected to tMap and the tMap output to a .csv output where I'm going to have two fields, the old timestamp and his correspondent DateTime.

 

csv input.JPG-> This is the .CSV file input

 

 

 

 

captura job.JPG

Now I'm going to show you the talend routine to convert timestamp in milliseconds to datetime ("dd:mm:YY HH.mm.ss.SSS")

 

rutine.JPG

 

In the next step, you only have to aplpy the created routine in the tMap output option, expression builder! Smiley Happy

 

tmapRotuine.JPG

Now just Run the job and woalah! \(^.^)/

 

csv ouptut.JPG-> .CSV file output

 

Pls, give me some Kudos if my response help you Smiley Very Happy

Thanks for your time and attention <3

 

 

Five Stars

Re: timestamp format

Hi,

 

I have a date format in the below form in the csv file. how can I convert this?

2015-01-01T05:00:00Z

or what is the expression used I can store in the proper format?

 

Please help

 

Nine Stars

Re: timestamp format

Hi,

 

Please try below.

TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss'Z'","2015-01-01T05:00:00Z"

Regards,

 

 

Veeru Boppudi
Five Stars

Re: timestamp format

thanks for the quick one... Smiley Happy