From 1d43b96364dbf159d15de6ed343498b0257b7c4f Mon Sep 17 00:00:00 2001 From: sbbs <> Date: Wed, 25 Nov 2015 06:22:13 +0000 Subject: [PATCH] Bug-fix: xpTimeZone_local() returned the UTC-offset as they daylight saving time was in effect, year-round, on Linux. Use the localtime() tm_gmtoff method of detecting the local time zone offset on Linux, don't rely on the global variables 'timezone' and 'daylight' behaving as they did in Borland C/DOS. From the Linux man page: Note that the variable daylight does not indicate that daylight saving time applies right now. --- src/xpdev/xpdatetime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xpdev/xpdatetime.c b/src/xpdev/xpdatetime.c index 83dc01b0bd..53a25889b5 100644 --- a/src/xpdev/xpdatetime.c +++ b/src/xpdev/xpdatetime.c @@ -87,7 +87,7 @@ xpDateTime_t DLLCALL xpDateTime_now(void) /* Return local timezone offset (in minutes) */ xpTimeZone_t DLLCALL xpTimeZone_local(void) { -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DARWIN__) +#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DARWIN__) || defined(__linux__) struct tm tm; time_t t; -- GitLab