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

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


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.)

permanent link

answered 27 Jul '13, 23:54

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×11
×11

question asked: 27 Jul '13, 21:02

question was seen: 3,667 times

last updated: 27 Jul '13, 23:55

p​o​w​e​r​e​d by O​S​Q​A