From bf2cc7c45cf5bd765115158a991c7ea7e0c5c4a8 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Wed, 4 Mar 2020 22:12:49 +0800 Subject: [PATCH] fix timezone build issue with msvc on Windows. --- src/util/src/ttime.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/src/ttime.c b/src/util/src/ttime.c index 65c5d0ea4c..5d5b580a89 100644 --- a/src/util/src/ttime.c +++ b/src/util/src/ttime.c @@ -59,6 +59,10 @@ int64_t user_mktime64(const unsigned int year0, const unsigned int mon0, int64_t res = (((((int64_t) (year/4 - year/100 + year/400 + 367*mon/12 + day) + year*365 - 719499)*24 + hour)*60 + min)*60 + sec); +#if defined(WINDOWS) && _MSC_VER >= 1900 + // see https://docs.microsoft.com/en-us/cpp/c-runtime-library/daylight-dstbias-timezone-and-tzname?view=vs-2019 + int64_t timezone = _timezone; +#endif return (res + timezone); } // ==== mktime() kernel code =================// -- GitLab