diff --git a/README.md b/README.md index e96ba85..4f5fb13 100644 --- a/README.md +++ b/README.md @@ -124,8 +124,9 @@ typing ``make``. a workaround, use the ``-ffunction-sections -Wl,--gc-sections`` linker flags (or equivalent) to remove the unused functions (parsers) from the final image. * Some systems lack ``timegm``. On these systems, the recommended course of - action is to build with ``-Dtimegm=mktime`` - assuming the system runs in the - default ``UTC`` timezone. + action is to build with ``-Dtimegm=mktime`` which will work correctly as long + the system runs in the default ``UTC`` timezone. Native Windows builds should + use ``-Dtimegm=_mkgmtime`` instead which will work correctly in all timezones. ## Bugs diff --git a/minmea.c b/minmea.c index 8ef653a..00f9fe2 100644 --- a/minmea.c +++ b/minmea.c @@ -531,7 +531,7 @@ int minmea_gettimeofday(struct timeval *tv, const struct minmea_date *date, cons tm.tm_min = time_->minutes; tm.tm_sec = time_->seconds; - time_t timestamp = timegm(&tm); + time_t timestamp = timegm(&tm); /* See README.md if your system lacks timegm(). */ if (timestamp != -1) { tv->tv_sec = timestamp; tv->tv_usec = time_->microseconds;