"Claimed At" attribute in inventory API endpoint

Solved
Raphael_M
Here to help

"Claimed At" attribute in inventory API endpoint

Hello everyone,

 

I am struggling to understand how to interpret the "Claimed At" attribute that is returned in the "getOrganizationInventory" endpoint.

I guess this is supposed to indicate the date at which the device was claimed, but I don't get which date format it is using.

 

Below is an extract from the official API documentation.

image.png

 

Does anyone know how to convert this integer (1518365681 in this case) into a date ?

1 Accepted Solution
CptnCrnch
Kind of a big deal
Kind of a big deal

It's simply a Unix timestamp, based on seconds since Jan 01 1970.

 

1518365681

Is equivalent to:

02/11/2018 @ 4:14pm (UTC)

(https://www.unixtimestamp.com)

 

In Python, conversion could like like this

from datetime import datetime
timestamp = 1518365681
dt_object = datetime.fromtimestamp(timestamp)
print(dt_object)

 

View solution in original post

3 Replies 3
CptnCrnch
Kind of a big deal
Kind of a big deal

It's simply a Unix timestamp, based on seconds since Jan 01 1970.

 

1518365681

Is equivalent to:

02/11/2018 @ 4:14pm (UTC)

(https://www.unixtimestamp.com)

 

In Python, conversion could like like this

from datetime import datetime
timestamp = 1518365681
dt_object = datetime.fromtimestamp(timestamp)
print(dt_object)

 

Raphael_M
Here to help

I knew it had something really simple 😅

 

Thanks for the quick answer !

Nash
Kind of a big deal

Shoutout to unixtimestamp.com! I'd be doomed without it.

Get notified when there are additional replies to this discussion.