We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 66732e7 commit 53b641dCopy full SHA for 53b641d
quickjs.c
@@ -43386,9 +43386,14 @@ static const JSCFunctionListEntry js_math_obj[] = {
43386
between UTC time and local time 'd' in minutes */
43387
static int getTimezoneOffset(int64_t time) {
43388
#if defined(_WIN32)
43389
- TIME_ZONE_INFORMATION time_zone_info;
43390
- GetTimeZoneInformation(&time_zone_info);
43391
- return (int)time_zone_info.Bias / 60;
+ DWORD r;
+ TIME_ZONE_INFORMATION t;
+ r = GetTimeZoneInformation(&t);
43392
+ if (r == TIME_ZONE_ID_INVALID)
43393
+ return 0;
43394
+ if (r == TIME_ZONE_ID_DAYLIGHT)
43395
+ return (int)(t.Bias + t.DaylightBias);
43396
+ return (int)t.Bias;
43397
#else
43398
time_t ti;
43399
struct tm tm;
0 commit comments