Changeset 10571 in webkit for trunk/JavaScriptCore/kjs/date_object.cpp
- Timestamp:
- Sep 20, 2005, 1:07:57 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/date_object.cpp
r10483 r10571 466 466 // months 467 467 if (maxArgs >= 2 && idx < numArgs) { 468 int months = args[idx++]->toInt32(exec); 469 470 // t->tm_year must hold the bulk of the data to avoid overflow when converting 471 // to a CFGregorianDate. (CFGregorianDate.month is an SInt8; CFGregorianDate.year is an SInt32.) 472 t->tm_year += months / 12; 473 t->tm_mon = months % 12; 468 t->tm_mon = args[idx++]->toInt32(exec); 474 469 } 475 470 … … 1015 1010 int utcOffset; 1016 1011 if (utc) { 1017 1012 time_t zero = 0; 1018 1013 #if defined BSD || defined(__linux__) || defined(__APPLE__) 1019 1014 struct tm t3; … … 1031 1026 #endif 1032 1027 } else { 1033 utcOffset = 0; 1034 t->tm_isdst = -1; 1035 } 1028 utcOffset = 0; 1029 t->tm_isdst = -1; 1030 } 1031 1032 // t->tm_year must hold the bulk of the data to avoid overflow when converting 1033 // to a CFGregorianDate. (CFGregorianDate.month is an SInt8; CFGregorianDate.year is an SInt32.) 1034 t->tm_year += t->tm_mon / 12; 1035 t->tm_mon %= 12; 1036 1036 1037 1037 1038 double yearOffset = 0.0;
Note:
See TracChangeset
for help on using the changeset viewer.