mbakholdina / lib-tcpdump-processing

Library designed to process .pcap(ng) tcpdump or Wireshark trace files and extract SRT packets of interest for further analysis
15 stars 3 forks source link

Apply datetime timezone mapping #46

Closed maxsharabayko closed 1 year ago

maxsharabayko commented 1 year ago

Fixes the following warning:

dateutil\parser\_parser.py:1207: UnknownTimezoneWarning: tzname CET identified but not understood.
Pass `tzinfos` argument in order to correctly return a timezone-aware datetime.
In a future version, this will raise an exception.

when the following time is parsed:

May  2, 2023 18:29:52.295798000 CET

Followed this suggestion: https://stackoverflow.com/questions/67061724/panda-to-datetime-raises-warning-tzname-cet-identified-but-not-understood

Also fixed

  File "D:\Projects\srt\lib-tcpdump-processing\venv\lib\site-packages\dateutil\parser\_parser.py", line 643, in parse
    raise ParserError("Unknown string format: %s", timestr)
dateutil.parser._parser.ParserError: Unknown string format: Apr  1, 2020 16:29:53.150479000 W. Europe Daylight Time

with a workaround

srt_packets['frame.time'].replace('W. Europe Daylight Time','CEST', inplace=True, regex=True)
mbakholdina commented 1 year ago

Addressed in PR #47.