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.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.