Issue 129 in dpkt: Time stamp problem in dpkt

18 views
Skip to first unread message

dp...@googlecode.com

unread,
Aug 16, 2014, 5:55:43 AM8/16/14
to dp...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 129 by mh3nmshy...@gmail.com: Time stamp problem in dpkt
http://code.google.com/p/dpkt/issues/detail?id=129

I used dpkt for parsing a pcap file. but when I printed timestamp(ts)
output was like this:1408173480.93
but I need ts should have 6 float digit. for example:1408173480.936543
what should I do?



--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

dp...@googlecode.com

unread,
Dec 24, 2014, 11:13:45 PM12/24/14
to dp...@googlegroups.com
Updates:
Status: Accepted
Owner: kba...@in2void.com

Comment #1 on issue 129 by kba...@in2void.com: Time stamp problem in dpkt
https://code.google.com/p/dpkt/issues/detail?id=129

(No comment was entered for this change.)

dp...@googlecode.com

unread,
Dec 25, 2014, 12:53:26 AM12/25/14
to dp...@googlegroups.com
Updates:
Status: WontFix

Comment #2 on issue 129 by kba...@in2void.com: Time stamp problem in dpkt
https://code.google.com/p/dpkt/issues/detail?id=129

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'

dp...@googlecode.com

unread,
Dec 25, 2014, 2:00:42 AM12/25/14
to dp...@googlegroups.com

Comment #3 on issue 129 by kba...@in2void.com: Time stamp problem in dpkt
https://code.google.com/p/dpkt/issues/detail?id=129

Issue 46 has been merged into this issue.
Reply all
Reply to author
Forward
0 new messages