Skip to main content

I 'am reading a Json file that contains a timestamp. I need to convert this to a date so that I can aggregate other data on Year, Month.

I've tried using an attributemananger (@value/86400)+25569+(-5/24) and DatConverter to convert the timestamp but this didn't gave me any results.

Therefore my question how to do this?

What is the format of the timestamp in your json? It would be helpful if you could post an example here.



This is an example of a timestamp. "lastUpdated":1502349196

But additional: In my attributemanager I am using the Arithmetic editor. This results in a number.

Do I have to do something to convert this back to a string? I thought I read something that FME automatically convert this when needed.


If it's the seconds since the Unix epoch you can use the DateTimeConvertor. Source format is %s, output format can be FME or ISO date, whichever you prefer.


If it's the seconds since the Unix epoch you can use the DateTimeConvertor. Source format is %s, output format can be FME or ISO date, whichever you prefer.

Ok, I feel a bit stupid now. I've read the help but it didn't came up to me that I could change the Source Date Format. This works (of course)! Thanks.

 

 


Reply