Skip to content

Commit

Permalink
webgpsmap: fix parsing new timezone format "Z" in gps data
Browse files Browse the repository at this point in the history
fix timezone "Z": "2019-11-28T04:44:46.79231Z" >> "2019-11-28T04:44:46.79231+00:00"
issue: #708
  • Loading branch information
xenDE authored Dec 15, 2019
1 parent e0a66f5 commit 44138ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pwnagotchi/plugins/default/webgpsmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ def timestamp_last(self):
elif 'Updated' in self._json:
# convert gps datetime to unix timestamp: "2019-10-05T23:12:40.422996+01:00"
date_iso_formated = self._json['Updated']
#fix timezone "Z": "2019-11-28T04:44:46.79231Z" >> "2019-11-28T04:44:46.79231+00:00"
if date_iso_formated.endswith("Z"):
date_iso_formated = date_iso_formated[:-1] + "+00:00"
# bad microseconds fix: fill/cut microseconds to 6 numbers
part1, part2, part3 = re.split('\.|\+', date_iso_formated)
part2 = part2.ljust(6, '0')[:6]
Expand Down

0 comments on commit 44138ba

Please sign in to comment.