WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
4142
Date object does not always adjust daylight savings correctly
https://bugs.webkit.org/show_bug.cgi?id=4142
Summary
Date object does not always adjust daylight savings correctly
Carsten Guenther
Reported
2005-07-26 11:06:56 PDT
This will fix ecma/Date/15.9.4.3.js ecma/Date/15.9.5.28-1.js There seems to be a problem with daylight savings when a time change crosses the daylight savings start/ end dates.
Attachments
Patch
(957 bytes, patch)
2005-10-09 14:58 PDT
,
Geoffrey Garen
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Geoffrey Garen
Comment 1
2005-07-26 11:15:11 PDT
(In reply to
comment #0
) FYI, Mac IE has the same problem. Win IE and Mac FF don't.
George Staikos
Comment 2
2005-10-03 12:35:01 PDT
Adding this before the return in KJS::makeTime() fixes it for me: // Determine if we passed over a DST change boundary if (!utc) { time_t tval = mktime(t) + utcOffset + int((ms + yearOffset)/1000); struct tm t3; localtime_r(&tval, &t3); t->tm_isdst = t3.tm_isdst; } Does not seem to introduce any regressions. I am a bit worried about overflow and rounding though. It might break down very close to the changeover period.
Geoffrey Garen
Comment 3
2005-10-09 14:58:00 PDT
Created
attachment 4271
[details]
Patch Implemented George's suggestion.
Darin Adler
Comment 4
2005-10-09 16:00:35 PDT
Comment on
attachment 4271
[details]
Patch What's the rationale for calling the local variable "t3"? The FIXME says "on some systems", but this will happen on all systems; there's no system where time_t has enough range to include all the years we want our function to handle. So I suggest re-wording it. Otherwise, looks fine.
George Staikos
Comment 5
2005-10-10 15:47:43 PDT
There is already a t and a t2, and although t3 wasn't perhaps the best sequel, I didn't see fit to leave it out. :-) And yes, "all systems" is correct. I don't know if it's a realistic problem to put more effort into at this time though.
John Sullivan
Comment 6
2005-10-24 13:45:37 PDT
I checked this in. It did fix ecma/Date/15.9.5.28-1.js, but ecma/Date/15.9.4.3.js was apparently fixed by some earlier checkin.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug