From 82699ecce887a4e223090cd451e796e27987ae4a Mon Sep 17 00:00:00 2001 From: xywang Date: Thu, 28 Oct 2021 13:43:21 +0200 Subject: [PATCH] [TS-471]: fixed that queries in timezone with DST were incorrect --- src/os/src/darwin/dwSysInfo.c | 2 ++ src/os/src/detail/osSysinfo.c | 2 ++ src/os/src/windows/wSysinfo.c | 11 +++++++++++ 3 files changed, 15 insertions(+) diff --git a/src/os/src/darwin/dwSysInfo.c b/src/os/src/darwin/dwSysInfo.c index 54c6fb1d32..a87a15a3f2 100644 --- a/src/os/src/darwin/dwSysInfo.c +++ b/src/os/src/darwin/dwSysInfo.c @@ -65,6 +65,8 @@ static void taosGetSystemTimezone() { struct tm tm1; localtime_r(&tx1, &tm1); + tsDaylight = daylight; + /* * format example: * diff --git a/src/os/src/detail/osSysinfo.c b/src/os/src/detail/osSysinfo.c index 8094358853..64d33be40e 100644 --- a/src/os/src/detail/osSysinfo.c +++ b/src/os/src/detail/osSysinfo.c @@ -213,6 +213,8 @@ static void taosGetSystemTimezone() { int32_t tz = (-timezone * MILLISECOND_PER_SECOND) / MILLISECOND_PER_HOUR; tz += daylight; + tsDaylight = daylight; + /* * format example: * diff --git a/src/os/src/windows/wSysinfo.c b/src/os/src/windows/wSysinfo.c index 89101ee148..831a6bdaf0 100644 --- a/src/os/src/windows/wSysinfo.c +++ b/src/os/src/windows/wSysinfo.c @@ -91,6 +91,17 @@ static void taosGetSystemTimezone() { strcpy(tsTimezone, tz); } cfg_timezone->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT; + +#ifdef _MSC_VER +#if _MSC_VER >= 1900 + int64_t timezone = _timezone; + int32_t daylight = _daylight; + char **tzname = _tzname; +#endif +#endif + + tsDaylight = daylight; + uInfo("timezone not configured, use default"); } } -- GitLab