Meraki API responding with strange Timestamps for when getting organizations/<id>/admins

SOLVED
JansenW
New here

Meraki API responding with strange Timestamps for when getting organizations/<id>/admins

Hi, I'm building a dashboard using Meraki's API for my job, and they want me to have a list of recently logged in/active Meraki Admin accounts. My problem is that I am getting some very weird timestamps in the lastActive field that I am having trouble interpreting, here is an example of one of the responses I am getting:

{"name":"xxxxx","email":"xxxx","id":"xxxx","networks":[],"tags":[],"twoFactorAuthEnabled":xxxx,"lastActive":1559588125,"accountStatus":"xxxx","hasApiKey":xxxxxx,"orgAccess":"xxxxxxxxxx"}

 

Any help figuring out the format of that timestamp would be much appreciated. 

Thanks,

Jansen

1 ACCEPTED SOLUTION
4 REPLIES 4
jdsilva
Kind of a big deal

Thanks! 

MaddogJulie
Here to help

You can format it using datetime:

>>> tmpDate=datetime.fromtimestamp(<timestamp var>)

>>> tmpdate.strftime("%B %d, %Y - %H:%M:%S%p")

'June 03, 2019 - 14:55:25PM'

I just needed to know the format, converting it to a C# DateTime was the easy part for me. Thanks though!

Get notified when there are additional replies to this discussion.