Closed GoogleCodeExporter closed 9 years ago
I am assuming that you are doing something like this:
for ts, buf in pcap:
print ts
And then you observe the timestamp to be "1408173480.93" instead
of "1408173480.936543", as shown in wireshark. This is because the print
function in python limits float to two decimal places.
Example:
>>> x = 1258494066.119061
>>> x
1258494066.119061
>>> print x
1258494066.12
If you really need to print the full value, use format:
>>> "{0:.6f}".format(x)
'1258494066.119061'
If you have a nanosecond capture file, the place you will need to make the
change is in the __iter__() function of the pcap.py module. Instead of dividing
hdr.tv_usec by 1000000.0, you will need to divide it by 1000000000.0
Original comment by kbandla@in2void.com
on 25 Dec 2014 at 7:00
Original issue reported on code.google.com by
stuart.j...@gmail.com
on 30 Aug 2010 at 4:59