Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement getTimezoneOffset for Win32 #291

Merged
merged 3 commits into from
Mar 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#include <assert.h>
#if !defined(_MSC_VER)
#include <sys/time.h>
#if defined(_WIN32)
#include <timezoneapi.h>
#endif
#endif
#include <time.h>
#include <fenv.h>
Expand Down Expand Up @@ -40827,8 +40830,9 @@ static const JSCFunctionListEntry js_math_obj[] = {
between UTC time and local time 'd' in minutes */
static int getTimezoneOffset(int64_t time) {
#if defined(_WIN32)
/* XXX: TODO */
return 0;
TIME_ZONE_INFORMATION time_zone_info;
GetTimeZoneInformation(&time_zone_info);
return (int)time_zone_info.Bias / 60;
#else
time_t ti;
struct tm tm;
Expand Down
Loading