cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

SOLVED
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

Accepted Solutions
Kind of a big deal

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

4 REPLIES 4
Kind of a big deal

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

New here

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

Thanks! 

Highlighted
Here to help

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

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'

New here

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

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