I am trying to interact with an API that uses a timestamp that starts at a different time than UNIX epoch. It appears to start counting on 2000-01-01, but I'm not sure exactly how to do the conversion or what the name of this datetime format is.
When I send a message at 1456979510 I get a response back saying it was received at 510294713.
The difference between the two is 946684796 (sometimes 946684797) seconds, which is approximately 30 years.
Can anyone let me know the proper way to convert between the two? Or whether I can generate them outright in Python?
Thanks
Edit
An additional detail I should have mentioned is that this is an API to a Zigbee device. I found the following datatype entry in their documentation:
1.3.2.7 Absolute time
This is an unsigned 32-bit integer representation for absolute time. Absolute time is measured in seconds from midnight, 1st January 2000.
I'm still not sure the easiest way to convert between the two
The time 1 January 1970 00:00:00 is considered the UNIX epoch. So, if you want to convert from UNIX time to a timestamp having an epoch of January 1, 2000 (Let's say, 2000 epoch) the simplest way would be to simply subtract the UNIX time of January 1, 2000 from the UNIX time.
<2000 time> = <UNIX time> - <January 1, 2000 UNIX time>
<UNIX time> = <2000 time> + <January 1, 2000 UNIX time>
Where January 1, 2000 UNIX time is 946684800.
EDIT: The docs does say
Absolute time is measured in seconds from midnight, 1st January 2000.
So, 946684800
is the exact time difference which should be used to calculate. The few seconds difference that you calculated could be attributed to network delay or some other delays.