Summary: | [WIN] Use GetDateFormat and GetTimeFormat instead of strftime | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Patrick R. Gansterer <paroga> | ||||||
Component: | Platform | Assignee: | Patrick R. Gansterer <paroga> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | aestes, aroben, bfulgham, jberlin, jhoneycutt, sfalken, yosin | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | Windows 7 | ||||||||
Attachments: |
|
Description
Patrick R. Gansterer
2012-04-08 12:17:13 PDT
Created attachment 136154 [details]
Patch
Comment on attachment 136154 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=136154&action=review > Source/JavaScriptCore/runtime/DatePrototype.cpp:233 > + UChar buffer[128]; How do we know this is long enough? Maybe we should use something like Vector<UChar, 128> and grow it if it turns out to be too small. Created attachment 144922 [details]
Patch
Comment on attachment 144922 [details]
Patch
Looks good to me!
Committed r123293: <http://trac.webkit.org/changeset/123293> FYI: GetTimeFormat works only for year 1601 to 320827. http://msdn.microsoft.com/en-us/library/windows/desktop/ms724950(v=vs.85).aspx It doesn't cover full JavaScript Date range. https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/ GetTimeFormat also doesn't work with HTML5 Date range. So, we implemented formatDate for Windows in WebCore. http://trac.webkit.org/browser/trunk/Source/WebCore/platform/text/LocaleWin.cpp (In reply to comment #6) > GetTimeFormat works only for year 1601 to 320827. > http://msdn.microsoft.com/en-us/library/windows/desktop/ms724950(v=vs.85).aspx Yes, but the current call to strftime() does not even return correct values for dates before 1900 on my windows 7 machine with VS2010. |