Skip to content

Commit 9b4ab41

Browse files
committed
fix(timezone): simplify timezone offset retrieval logic in getTZOffsetAtTicks function
1 parent cfb77ab commit 9b4ab41

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

source/common/src/ttime.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -899,18 +899,7 @@ static int64_t getTZOffsetAtTicks(int64_t ticks, int32_t precision, timezone_t t
899899
__FUNCTION__, ticks, ERRNO);
900900
return 0;
901901
}
902-
#ifdef WINDOWS
903-
if (tz != NULL) {
904-
WindowsTimezoneObj *tz_obj = (WindowsTimezoneObj *)tz;
905-
taosThreadMutexLock(&tz_obj->mutex);
906-
int64_t offset = -(int64_t)tz_obj->offset_seconds * factor;
907-
taosThreadMutexUnlock(&tz_obj->mutex);
908-
return offset;
909-
}
910-
return -(int64_t)getWindowsTimezoneOffset() * factor;
911-
#else
912-
return (int64_t)tm_local.tm_gmtoff * factor;
913-
#endif
902+
return (int64_t)(taosTimeGm(&tm_local) - t_sec) * factor;
914903
}
915904

916905
int64_t taosTimeTruncate(int64_t ts, const SInterval* pInterval) {

0 commit comments

Comments
 (0)