OLD | NEW |
1 /* Portions are Copyright (C) 2007 Google Inc */ | 1 /* Portions are Copyright (C) 2007 Google Inc */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 localTime.tm_hour = result->tm_hour; | 1142 localTime.tm_hour = result->tm_hour; |
1143 localTime.tm_mday = result->tm_mday; | 1143 localTime.tm_mday = result->tm_mday; |
1144 localTime.tm_mon = result->tm_month; | 1144 localTime.tm_mon = result->tm_month; |
1145 localTime.tm_year = result->tm_year - 1900; | 1145 localTime.tm_year = result->tm_year - 1900; |
1146 /* Set this to -1 to tell mktime "I don't care". If you set | 1146 /* Set this to -1 to tell mktime "I don't care". If you set |
1147 it to 0 or 1, you are making assertions about whether the | 1147 it to 0 or 1, you are making assertions about whether the |
1148 date you are handing it is in daylight savings mode or not; | 1148 date you are handing it is in daylight savings mode or not; |
1149 and if you're wrong, it will "fix" it for you. */ | 1149 and if you're wrong, it will "fix" it for you. */ |
1150 localTime.tm_isdst = -1; | 1150 localTime.tm_isdst = -1; |
1151 | 1151 |
1152 #if _MSC_VER >= 1400 /* 1400 = Visual C++ 2005 (8.0) */ | 1152 #if _MSC_VER == 1400 /* 1400 = Visual C++ 2005 (8.0) */ |
1153 /* | 1153 /* |
1154 * mktime will return (time_t) -1 if the input is a date | 1154 * mktime will return (time_t) -1 if the input is a date |
1155 * after 23:59:59, December 31, 3000, US Pacific Time (not | 1155 * after 23:59:59, December 31, 3000, US Pacific Time (not |
1156 * UTC as documented): | 1156 * UTC as documented): |
1157 * http://msdn.microsoft.com/en-us/library/d1y53h2a(VS.80).asp
x | 1157 * http://msdn.microsoft.com/en-us/library/d1y53h2a(VS.80).asp
x |
1158 * But if the year is 3001, mktime also invokes the invalid | 1158 * But if the year is 3001, mktime also invokes the invalid |
1159 * parameter handler, causing the application to crash. This | 1159 * parameter handler, causing the application to crash. This |
1160 * problem has been reported in | 1160 * problem has been reported in |
1161 * http://connect.microsoft.com/VisualStudio/feedback/ViewFeed
back.aspx?FeedbackID=266036. | 1161 * http://connect.microsoft.com/VisualStudio/feedback/ViewFeed
back.aspx?FeedbackID=266036. |
1162 * We avoid this crash by not calling mktime if the date is | 1162 * We avoid this crash by not calling mktime if the date is |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 + 60 * localTime.tm_hour | 1194 + 60 * localTime.tm_hour |
1195 + 1440 * (localTime.tm_mday - 2); | 1195 + 1440 * (localTime.tm_mday - 2); |
1196 } | 1196 } |
1197 | 1197 |
1198 result->tm_params.tp_gmt_offset = zone_offset * 60; | 1198 result->tm_params.tp_gmt_offset = zone_offset * 60; |
1199 result->tm_params.tp_dst_offset = dst_offset * 60; | 1199 result->tm_params.tp_dst_offset = dst_offset * 60; |
1200 | 1200 |
1201 *result_imploded = PR_ImplodeTime(result); | 1201 *result_imploded = PR_ImplodeTime(result); |
1202 return PR_SUCCESS; | 1202 return PR_SUCCESS; |
1203 } | 1203 } |
OLD | NEW |