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

Hi, within my protocol I have an 8 byte value, int64, which contains the number of microseconds since the epoch. What I would like to do is place this into the tree in a human readable format but I'm struggling.

This is what I use to display the value of the int64. msg_header:add(buf(12,8),"Timestamp: " .. buf(12,8):le_int64())

Help would be much appreciated.

Thanks, Bart

asked 01 Apr '16, 05:27

sbart's gravatar image

sbart
6112
accept rate: 0%


Found my own answer.

msg_header:add(buf(12,8),"Timestamp: " .. os.date("%x %X",(buf(12,8):le_int64()):tonumber()/1000000) .. "." .. (buf(12,8):le_int64()):tonumber()%1000000)

permanent link

answered 01 Apr '16, 08:46

sbart's gravatar image

sbart
6112
accept rate: 0%

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:

×431
×62

question asked: 01 Apr '16, 05:27

question was seen: 1,540 times

last updated: 01 Apr '16, 08:46

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