Bug 91936 - [WIN] Use GetTimeZoneInformation() for getting the timezone name
Summary: [WIN] Use GetTimeZoneInformation() for getting the timezone name
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Patrick R. Gansterer
URL:
Keywords:
Depends on: 92282
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-22 01:18 PDT by Patrick R. Gansterer
Modified: 2012-08-08 00:31 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.07 KB, patch)
2012-07-22 01:20 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff
Patch (2.00 KB, patch)
2012-08-07 03:00 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick R. Gansterer 2012-07-22 01:18:40 PDT
[WIN] Use GetTimeZoneInformation() for getting the timezone name
Comment 1 Patrick R. Gansterer 2012-07-22 01:20:48 PDT
Created attachment 153686 [details]
Patch
Comment 2 Ryosuke Niwa 2012-07-23 01:24:53 PDT
Comment on attachment 153686 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=153686&action=review

> Source/JavaScriptCore/runtime/DateConversion.cpp:93
> +    DWORD result = GetTimeZoneInformation(&timeZoneInformation);

I would have named this variable daylightType instead.

> Source/JavaScriptCore/runtime/DateConversion.cpp:94
> +    CString timeZoneNameString = String(result == TIME_ZONE_ID_DAYLIGHT ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName).latin1();

It's unfortunate that we have to convert WCHAR to char here.
I would use ascii().data() instead possibly allocating String as a local variable.
Comment 3 Ryosuke Niwa 2012-07-23 01:30:14 PDT
Comment on attachment 153686 [details]
Patch

Okay, I withdraw my r+. We need to be more careful here. I thought DaylightName could only be 3-letter abbreviations but this apparently isn't the case. It could be a full long timezone name.
Comment 4 Patrick R. Gansterer 2012-08-07 03:00:29 PDT
Created attachment 156901 [details]
Patch
Comment 5 Ryosuke Niwa 2012-08-07 23:25:02 PDT
Comment on attachment 156901 [details]
Patch

This is more like it!
Comment 6 WebKit Review Bot 2012-08-08 00:31:28 PDT
Comment on attachment 156901 [details]
Patch

Clearing flags on attachment: 156901

Committed r125004: <http://trac.webkit.org/changeset/125004>
Comment 7 WebKit Review Bot 2012-08-08 00:31:32 PDT
All reviewed patches have been landed.  Closing bug.