NemaTode
NemaTode copied to clipboard
GPSTimestamp getTime() is Off by One Month
The month of year field in $GPRMC sentences is indexed 1-12. This is also how it it is stored in the month
class member of GPSTimestamp
. In getTime()
, however mktime()
is called, which expects months be 0-11.
This results in the timestamp returned by getTime
being off by one month.
I have fixed this in my local copy by changing line 170 in src/GPSFix.cpp from t.tm_mon = month;
to t.tm_mon = month - 1;
.
I found this too! Thank you @hicklin But your build has error and cannot build without edition. 'timezone' identifier in 'getTime' func comes out of nowhere. Maybe you have missing commit or something.