Skip to content

Commit

Permalink
Fix a bug in the GPS time parsing.
Browse files Browse the repository at this point in the history
This causes it to emit incorrect time reference messages if the
system time is off the GPS time by more than a second.
  • Loading branch information
djpetti authored and evenator committed Nov 21, 2022
1 parent 340c6bd commit b168f49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libnmea_navsat_driver/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def convert_time(nmea_utc):
# Resolve the ambiguity of day
day_offset = int((utc_time.hour - hours)/12.0)
utc_time += datetime.timedelta(day_offset)
utc_time.replace(hour=hours, minute=minutes, second=seconds)
utc_time = utc_time.replace(hour=hours, minute=minutes, second=seconds)

unix_secs = calendar.timegm(utc_time.timetuple())
return (unix_secs, nanosecs)
Expand Down

0 comments on commit b168f49

Please sign in to comment.