Skip to content

Commit 4f66cd7

Browse files
author
GaoJian
committed
fix: support ISO 8601 timestamp format in Packet.sniff_time for tshark 4.6+ JSON/EK output
1 parent 4517bdf commit 4f66cd7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/pyshark/packet/packet.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def __bool__(self):
8383

8484
@property
8585
def sniff_time(self) -> datetime.datetime:
86+
if self.sniff_timestamp[-1] == 'Z':
87+
return datetime.datetime.fromisoformat(self.sniff_timestamp)
8688
try:
8789
timestamp = float(self.sniff_timestamp)
8890
except ValueError:

0 commit comments

Comments
 (0)