From b168f499349e5f26e3aed9982deb44ed2f41f8e2 Mon Sep 17 00:00:00 2001 From: Daniel Petti Date: Sun, 16 Oct 2022 18:12:11 -0400 Subject: [PATCH] Fix a bug in the GPS time parsing. This causes it to emit incorrect time reference messages if the system time is off the GPS time by more than a second. --- src/libnmea_navsat_driver/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnmea_navsat_driver/parser.py b/src/libnmea_navsat_driver/parser.py index 25a177f..df40f13 100644 --- a/src/libnmea_navsat_driver/parser.py +++ b/src/libnmea_navsat_driver/parser.py @@ -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)