Changeset 20204 in webkit for trunk/JavaScriptCore/kjs/date_object.cpp
- Timestamp:
- Mar 14, 2007, 8:23:56 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/date_object.cpp
r20004 r20204 165 165 // Offset year if needed 166 166 struct tm localTM = gdt; 167 int year = gdt.year + 1900; 168 bool yearNeedsOffset = year < 1900 || year > 2038; 169 if (yearNeedsOffset) { 170 localTM.tm_year = equivalentYearForDST(year) - 1900; 171 } 167 localTM.tm_year = equivalentYearForDST(gdt.year + 1900) - 1900; 172 168 173 169 // Do the formatting … … 619 615 620 616 if (numArgs == 0) { // new Date() ECMA 15.9.3.3 621 #if PLATFORM(WIN_OS) 622 #if COMPILER(BORLAND) 623 struct timeb timebuffer; 624 ftime(&timebuffer); 625 #else 626 struct _timeb timebuffer; 627 _ftime(&timebuffer); 628 #endif 629 double utc = timebuffer.time * msPerSecond + timebuffer.millitm; 630 #else 631 struct timeval tv; 632 gettimeofday(&tv, 0); 633 double utc = floor(tv.tv_sec * msPerSecond + tv.tv_usec / 1000); 634 #endif 635 value = utc; 617 value = getCurrentUTCTime(); 636 618 } else if (numArgs == 1) { 637 619 if (args[0]->isObject(&DateInstance::info))
Note:
See TracChangeset
for help on using the changeset viewer.