derick Tue Dec 20 15:58:01 2005 EDT
Added files: (Branch: PHP_5_1)
/php-src/ext/date/tests bug35699.phpt
Modified files:
/php-src NEWS
/php-src/ext/date/lib unixtime2tm.c
Log:
- Fixed bug #35699 (date() can't handle leap years before 1970).
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.308&r2=1.2027.2.309&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.308 php-src/NEWS:1.2027.2.309
--- php-src/NEWS:1.2027.2.308 Tue Dec 20 15:33:03 2005
+++ php-src/NEWS Tue Dec 20 15:58:00 2005
@@ -39,6 +39,7 @@
options like '-1'). (Tony)
- Fixed bug #35705 (strtotime() fails to parse soap date format without TZ).
(Ilia)
+- Fixed bug #35699 (date() can't handle leap years before 1970). (Derick)
- Fixed bug #35694 (Improved error message for invalid fetch mode). (Ilia)
- Fixed bug #35692 (iconv_mime_decode() segmentation fault; with libiconv
only). (Tony)
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/unixtime2tm.c?r1=1.12.2.1&r2=1.12.2.2&diff_format=u
Index: php-src/ext/date/lib/unixtime2tm.c
diff -u php-src/ext/date/lib/unixtime2tm.c:1.12.2.1
php-src/ext/date/lib/unixtime2tm.c:1.12.2.2
--- php-src/ext/date/lib/unixtime2tm.c:1.12.2.1 Mon Dec 19 13:00:37 2005
+++ php-src/ext/date/lib/unixtime2tm.c Tue Dec 20 15:58:01 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: unixtime2tm.c,v 1.12.2.1 2005/12/19 13:00:37 derick Exp $ */
+/* $Id: unixtime2tm.c,v 1.12.2.2 2005/12/20 15:58:01 derick Exp $ */
#include "timelib.h"
@@ -93,6 +93,9 @@
DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year););
months = timelib_is_leap(cur_year) ? month_tab_leap : month_tab;
+ if (timelib_is_leap(cur_year) && cur_year < 1970) {
+ tmp_days--;
+ }
i = 11;
while (i > 0) {
DEBUG(printf("month=%lld (%d)\n", i, months[i]););
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/tests/bug35699.phpt?view=markup&rev=1.1
Index: php-src/ext/date/tests/bug35699.phpt
+++ php-src/ext/date/tests/bug35699.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php