summaryrefslogtreecommitdiff
path: root/src/time
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-03-17 16:59:21 +0100
committerMax Kellermann <max@musicpd.org>2020-04-01 16:21:29 +0200
commit672bc3ab671e59691cbafdb48a71f38ed3735b04 (patch)
treeed3a0e563c98d5a2c5ed67a5be9b9685fb136199 /src/time
parent62229f14da8d7794f73491c28db47fd9e1c25b3f (diff)
time/Convert: fix GetTimeZoneOffset() on Windows
Was using the wrong parameter.
Diffstat (limited to 'src/time')
-rw-r--r--src/time/Convert.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/time/Convert.cxx b/src/time/Convert.cxx
index 2351f4b52..352c60604 100644
--- a/src/time/Convert.cxx
+++ b/src/time/Convert.cxx
@@ -77,15 +77,15 @@ static time_t
GetTimeZoneOffset() noexcept
{
time_t t = 1234567890;
- struct tm tm;
- tm.tm_isdst = 0;
#ifdef _WIN32
struct tm *p = gmtime(&t);
#else
+ struct tm tm;
+ tm.tm_isdst = 0;
struct tm *p = &tm;
gmtime_r(&t, p);
#endif
- return t - mktime(&tm);
+ return t - mktime(p);
}
#endif /* !__GLIBC__ */