isabyr / frame_timestamp

29 stars 10 forks source link

Question: How is the offset 2208988800 derived? #5

Closed grantwilk closed 1 year ago

grantwilk commented 1 year ago

Hello,

Trying to read through and understand this implementation so I can use it for a project. Out of curiosity, how did you derive the constant 2208988800 that is used in the following line of code from this example?

uint32_t seconds = ((last_ntp_time >> 32) & 0xffffffff)-2208988800;

Thanks!

isabyr commented 1 year ago

Hi,

It is a NTP to UNIX timestamp conversion formula, difference between 1900 and 1970 in seconds

grantwilk commented 1 year ago

Ahhh that makes sense. Thank you for your quick response! Much appreciated.