Hi there, I am currently implementing a dissector in lua and I'm stuck with converting my microsecond timestamp to absolute_time. This is what I'm currenly doing:
I also tried it with a fixed time that I'm sure is correct:
At the output I get a completely wrong date. I guess the absolute_time is a ns-timestamp counting the ns since 1.1.1970 1:00:00 right? Anybody an idea what I'm doing wrong here? I'm greatful for every advise. Enno |
Your code's logic, and your statement about " Thus a manufactured If your packet's
Note: I haven't tested the above, but it should (hopefully) work. Works! Thank you very much! Perfect and very fast support!
(22 Aug '15, 08:22)
enno
|
Using
local tvb = ByteArray.new("13FCC7343B5EA000"):tvb("Time")
I get Aug 17, 1980 - which according to epochconverter.com is correct.What is it you expect it to be, and why?
Oh, and why are you getting the buffer's bytes, multiplying times a 1000, converting to hex, creating a new Tvb, and then using that new Tvb for the time?
Ahh, I kind of missed the first sentence, where you want to convert microseconds "timestamp" to ns-timestamp. I see what you're missing - I'll put it in an answer.