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 |
One Answer:
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) answered 01 Apr '16, 08:46 sbart |