Changeset 18514 in webkit
- Timestamp:
- Jan 1, 2007, 8:19:35 PM (18 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r18498 r18514 1 2007-01-01 David Kilzer <ddkilzer@webkit.org> 2 3 Reviewed by Darin. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=12057 6 REGRESSION: JavaScript Date Is One Day In The Future in GMT time zone 7 8 Because Mac OS X returns geographically and historically accurate time zone information, 9 converting Jan 02, 1970 12:00:00 AM to local time then subtracting 24 hours did not work 10 in GMT (London - England) since it was in BST (+0100) all year in 1970[1]. Instead, the 11 UTC offset is calculated by converting Jan 01, 2000 12:00:00 AM to local time then 12 subtracting that from the same date in UTC. 13 14 [1] http://en.wikipedia.org/wiki/British_Summer_Time 15 16 * kjs/DateMath.cpp: 17 (KJS::getUTCOffset): Updated UTC offset calculation. 18 (KJS::getDSTOffset): Improved comment. 19 1 20 2006-12-31 David Kilzer <ddkilzer@webkit.org> 2 21 -
trunk/JavaScriptCore/kjs/DateMath.cpp
r17520 r18514 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2006 Apple Computer3 * Copyright (C) 2006-2007 Apple Computer 4 4 * 5 5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 … … 300 300 301 301 memset(&localt, 0, sizeof(localt)); 302 303 // get the difference between this time zone and GMT304 localt.tm_mday = 2;305 localt.tm_year = 70;306 307 utcOffset = mktime(&localt) - (hoursPerDay * secondsPerHour); 308 utcOffset *= -msPerSecond;302 303 // get the difference between this time zone and UTC on Jan 01, 2000 12:00:00 AM 304 localt.tm_mday = 1; 305 localt.tm_year = 100; 306 utcOffset = 946684800.0 - mktime(&localt); 307 308 utcOffset *= msPerSecond; 309 309 310 310 utcOffsetInitialized = true; … … 359 359 // determining DST. For this reason we shift years that localtime can handle but would 360 360 // return historically accurate information. 361 362 // if before 2000 or after 2038361 362 // if before Jan 01, 2000 12:00:00 AM UTC or after Jan 01, 2038 12:00:00 AM UTC 363 363 if (ms < 946684800000.0 || ms > 2145916800000.0) { 364 364 int year;
Note:
See TracChangeset
for help on using the changeset viewer.