Bug 7107

Summary: Refactor Date object to provide direct access to milliseconds/offset
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: JavaScriptCoreAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Bug Depends on:    
Bug Blocks: 7012    
Attachments:
Description Flags
proposed patch darin: review+

Alexey Proskuryakov
Reported 2006-02-06 11:14:17 PST
This is needed to convert JavaScript dates to AppleScript ones in WebCore.
Attachments
proposed patch (10.13 KB, patch)
2006-02-06 11:31 PST, Alexey Proskuryakov
darin: review+
Alexey Proskuryakov
Comment 1 2006-02-06 11:31:18 PST
Created attachment 6294 [details] proposed patch While refactoring the code, I had to also make several Windows-specific changes. Apparently, the Windows _daylight global has a different meaning than seems to have been expected by GetTimezoneOffset implementation. In fact, _daylight is non-zero if the machine is configured to support daylight savings time, not when DST is active. In other words, there are two ways to make _daylight non-zero: 1) Tick "Automatically adjust clock for daylight saving changes" checkbox in Date and Time control panel - _daylight becomes 1 (the actual value is undocumented). 2) give TZ environment variable a value that includes a DST timezone. E.g.: set TZ=MSK3 -> _daylight=0 set TZ=MSK3MSD -> _daylight=77 (value depends on the timezone, also undocumented).
Darin Adler
Comment 2 2006-02-06 18:18:56 PST
Comment on attachment 6294 [details] proposed patch +static bool isTime_tSigned() +{ + time_t minusOne = (time_t)(-1); + return minusOne < 0; +} The above function should be marked inline, because if so it will act as a compile-time constant. If tested thoroughly, looks good, r=me.
Note You need to log in before you can comment on or make changes to this bug.