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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 #if HAVE(SYS_TIME_H) | 93 #if HAVE(SYS_TIME_H) |
94 #include <sys/time.h> | 94 #include <sys/time.h> |
95 #endif | 95 #endif |
96 | 96 |
97 using namespace WTF; | 97 using namespace WTF; |
98 | 98 |
99 namespace WTF { | 99 namespace WTF { |
100 | 100 |
101 /* Constants */ | 101 /* Constants */ |
102 | 102 |
103 static const double minutesPerDay = 24.0 * 60.0; | |
104 static const double secondsPerDay = 24.0 * 60.0 * 60.0; | 103 static const double secondsPerDay = 24.0 * 60.0 * 60.0; |
105 static const double secondsPerYear = 24.0 * 60.0 * 60.0 * 365.0; | |
106 | |
107 static const double usecPerSec = 1000000.0; | |
108 | 104 |
109 static const double maxUnixTime = 2145859200.0; // 12/31/2037 | 105 static const double maxUnixTime = 2145859200.0; // 12/31/2037 |
110 // ECMAScript asks not to support for a date of which total | 106 // ECMAScript asks not to support for a date of which total |
111 // millisecond value is larger than the following value. | 107 // millisecond value is larger than the following value. |
112 // See 15.9.1.14 of ECMA-262 5th edition. | 108 // See 15.9.1.14 of ECMA-262 5th edition. |
113 static const double maxECMAScriptTime = 8.64E15; | 109 static const double maxECMAScriptTime = 8.64E15; |
114 | 110 |
115 // Day of year for the first day of each month, where index 0 is January, and da
y 0 is January 1. | 111 // Day of year for the first day of each month, where index 0 is January, and da
y 0 is January 1. |
116 // First for non-leap years, then for leap years. | 112 // First for non-leap years, then for leap years. |
117 static const int firstDayOfMonth[2][12] = { | 113 static const int firstDayOfMonth[2][12] = { |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 | 1074 |
1079 stringBuilder.append(utcOffset > 0 ? '+' : '-'); | 1075 stringBuilder.append(utcOffset > 0 ? '+' : '-'); |
1080 int absoluteUTCOffset = abs(utcOffset); | 1076 int absoluteUTCOffset = abs(utcOffset); |
1081 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset / 60)); | 1077 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset / 60)); |
1082 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset % 60)); | 1078 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset % 60)); |
1083 | 1079 |
1084 return stringBuilder.toString(); | 1080 return stringBuilder.toString(); |
1085 } | 1081 } |
1086 | 1082 |
1087 } // namespace WTF | 1083 } // namespace WTF |
OLD | NEW |