Timestamp Script

Good afternoon team,

Hope all is well. I was wondering if you have a script that would return the data from the API with the real timestamp rather than the epoch time?

Kind Regards,
Sebastian

2 Likes

Hi Sebastian,

first of all, welcome to the community! We are always happy to receive and respond to your questions.

Based on what you are asking I wrote a comprehensive guide on how to retrieve results from the API in python, using the pagination features and write them into a CSV for further processing by other tools here:

To specifically answer your question notice the line which converts the epoch timestamp in milliseconds into a human readable timestamp here:

'ts': datetime.fromtimestamp(result['attributes']['ts'] / 1000).strftime('%Y-%m-%d %H:%M:%S'),

Let me know if you have any other questions regarding this or the API in general.

Thanks,
Panickos

1 Like