From 2dd1e05cf0271e6d2147fb1aec8dd6b2bd84eabe Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 14 Nov 2022 11:41:11 +0800 Subject: [PATCH] fix(timezone): taos_options apply new timezone --- source/util/src/tconfig.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index c1fee37610..5250f5dfcd 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -271,8 +271,14 @@ static int32_t cfgSetTimezone(SConfigItem *pItem, const char *value, ECfgSrcType cfgStypeStr(stype), value, terrstr()); return -1; } - pItem->stype = stype; + + // apply new timezone + char szTimezone[TD_TIMEZONE_LEN] = {0}; + int8_t dl; + enum TdTimezone tdOffset = TdZeroZone; + taosSetSystemTimezone(value, szTimezone, &dl, &tdOffset); + return 0; }