This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

how to handle time stamps with an epoch of January 1, 2000?

0

I am working on the zigbee portion of wireshark. Wireshark uses traditional gmtime function, which has epoch year 1970. But Zigbee has its own epoch year 2000 Jan 1st. Hence, when a NTP time 0x00000000 is passed on to wireshark, I expect it to be 2000. Jan .1st. But, when I use tvb_ntp_ts function, it gives me errors. How can I resolve this issue?

asked 27 Jul '13, 21:02

xjybentusi's gravatar image

xjybentusi
11112
accept rate: 0%

edited 27 Jul '13, 23:55

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196


One Answer:

2

NTP times use neither the UN*X epoch of January 1, 1970, 00:00:00 UTC nor the Zigbee epoch of January 1, 2000 (presumably also 00:00:00 UTC). It, instead, uses an epoch of January 1, 1900, 00:00:00 "UTC", so you can't use any NTP time stamp functions to deal with UN*X times or Zigbee times.

You would have to convert Zigbee times to UN*X/POSIX times; if you have a count of seconds since January 1, 2000, 00:00:00 UTC, you would have to add to it the number of seconds between January 1, 1970, 00:00:00 UTC and January 1, 2000, 00:00:00 UTC, and you could then use that, plus an optional count of nanoseconds, as a UN*X-style time stamp. (Calculating that number of seconds is left as an exercise to the reader.)

answered 27 Jul '13, 23:54

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%