Bug 91936

Summary: [WIN] Use GetTimeZoneInformation() for getting the timezone name
Product: WebKit Reporter: Patrick R. Gansterer <paroga>
Component: JavaScriptCoreAssignee: Patrick R. Gansterer <paroga>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, bfulgham, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Bug Depends on: 92282    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

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.