Changeset 44842 in webkit for trunk/JavaScriptCore/wtf
- Timestamp:
- Jun 18, 2009, 10:06:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/DateMath.cpp
r44765 r44842 362 362 static int32_t calculateUTCOffset() 363 363 { 364 time_t localTime = time(0); 364 365 tm localt; 365 memset(&localt, 0, sizeof(localt)); 366 367 // get the difference between this time zone and UTC on Jan 01, 2000 12:00:00 AM 366 getLocalTime(&localTime, &localt); 367 368 // Get the difference between this time zone and UTC on the 1st of January of this year. 369 localt.tm_sec = 0; 370 localt.tm_min = 0; 371 localt.tm_hour = 0; 368 372 localt.tm_mday = 1; 369 localt.tm_year = 100; 370 time_t utcOffset = 946684800 - mktime(&localt); 373 localt.tm_mon = 0; 374 // Not setting localt.tm_year! 375 localt.tm_wday = 0; 376 localt.tm_yday = 0; 377 localt.tm_isdst = 0; 378 localt.tm_zone = 0; 379 localt.tm_gmtoff = 0; 380 time_t utcOffset = timegm(&localt) - mktime(&localt); 371 381 372 382 return static_cast<int32_t>(utcOffset * 1000);
Note:
See TracChangeset
for help on using the changeset viewer.