OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) | 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) |
3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
4 * Copyright (C) 2009 Google Inc. All rights reserved. | 4 * Copyright (C) 2009 Google Inc. All rights reserved. |
5 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 5 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
6 * Copyright (C) 2010 &yet, LLC. (nate@andyet.net) | 6 * Copyright (C) 2010 &yet, LLC. (nate@andyet.net) |
7 * | 7 * |
8 * The Original Code is Mozilla Communicator client code, released | 8 * The Original Code is Mozilla Communicator client code, released |
9 * March 31, 1998. | 9 * March 31, 1998. |
10 * | 10 * |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 int month = monthFromDayInYear(dayInYearLocal, leapYear); | 447 int month = monthFromDayInYear(dayInYearLocal, leapYear); |
448 double day = dateToDaysFrom1970(equivalentYear, month, dayInMonth); | 448 double day = dateToDaysFrom1970(equivalentYear, month, dayInMonth); |
449 ms = (day * msPerDay) + msToMilliseconds(ms); | 449 ms = (day * msPerDay) + msToMilliseconds(ms); |
450 } | 450 } |
451 | 451 |
452 return calculateDSTOffsetSimple(ms / msPerSecond, utcOffset); | 452 return calculateDSTOffsetSimple(ms / msPerSecond, utcOffset); |
453 } | 453 } |
454 | 454 |
455 void initializeDates() | 455 void initializeDates() |
456 { | 456 { |
457 #if !ASSERT_DISABLED | 457 #if ASSERT_ENABLED |
458 static bool alreadyInitialized; | 458 static bool alreadyInitialized; |
459 ASSERT(!alreadyInitialized); | 459 ASSERT(!alreadyInitialized); |
460 alreadyInitialized = true; | 460 alreadyInitialized = true; |
461 #endif | 461 #endif |
462 | 462 |
463 equivalentYearForDST(2000); // Need to call once to initialize a static used
in this function. | 463 equivalentYearForDST(2000); // Need to call once to initialize a static used
in this function. |
464 } | 464 } |
465 | 465 |
466 static inline double ymdhmsToSeconds(int year, long mon, long day, long hour, lo
ng minute, double second) | 466 static inline double ymdhmsToSeconds(int year, long mon, long day, long hour, lo
ng minute, double second) |
467 { | 467 { |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 | 875 |
876 stringBuilder.append(utcOffset > 0 ? '+' : '-'); | 876 stringBuilder.append(utcOffset > 0 ? '+' : '-'); |
877 int absoluteUTCOffset = abs(utcOffset); | 877 int absoluteUTCOffset = abs(utcOffset); |
878 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset / 60)); | 878 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset / 60)); |
879 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset % 60)); | 879 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset % 60)); |
880 | 880 |
881 return stringBuilder.toString(); | 881 return stringBuilder.toString(); |
882 } | 882 } |
883 | 883 |
884 } // namespace WTF | 884 } // namespace WTF |
OLD | NEW |