diff options
author | Derick Rethans <derick@php.net> | 2005-12-20 15:58:01 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2005-12-20 15:58:01 +0000 |
commit | 97ec0f3db53a4b789d08cac473c54cff9b7d0692 (patch) | |
tree | 713767ba6ad536c071960659a306cba98f48e8c3 /ext/date/lib/unixtime2tm.c | |
parent | 3450841dbef749545ed5ee2307427674f9a93f31 (diff) | |
download | php-git-97ec0f3db53a4b789d08cac473c54cff9b7d0692.tar.gz |
- Fixed bug #35699 (date() can't handle leap years before 1970).
Diffstat (limited to 'ext/date/lib/unixtime2tm.c')
-rw-r--r-- | ext/date/lib/unixtime2tm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c index 0187abbcfb..412f86f2bb 100644 --- a/ext/date/lib/unixtime2tm.c +++ b/ext/date/lib/unixtime2tm.c @@ -93,6 +93,9 @@ void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts) 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]);); |