Skip to content

Commit

Permalink
- MFH: Fixed bug #46732 (mktime.year description is wrong).
Browse files Browse the repository at this point in the history
  • Loading branch information
Derick Rethans committed Dec 2, 2008
1 parent 1c3d201 commit 7a28b87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ext/date/php_date.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
case 6:
if (yea >= 0 && yea < 70) {
yea += 2000;
} else if (yea >= 70 && yea <= 110) {
} else if (yea >= 70 && yea <= 100) {
yea += 1900;
}
now->y = yea;
Expand Down
10 changes: 7 additions & 3 deletions ext/date/tests/mktime-3-64bit.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ error_reporting=2047
--FILE--
<?php
$tzs = array("America/Toronto", "Europe/Oslo");
$years = array(0, 69, 70, 71, 99, 100, 105, 1900, 1901, 1902, 1999, 2000, 2001);
$years = array(0, 69, 70, 71, 99, 100, 101, 105, 110, 1900, 1901, 1902, 1999, 2000, 2001);

foreach ($tzs as $tz) {
echo $tz, "\n";
Expand All @@ -32,7 +32,9 @@ Y: 70 - January 1970-01-01T01:01:01-0500
Y: 71 - January 1971-01-01T01:01:01-0500
Y: 99 - January 1999-01-01T01:01:01-0500
Y: 100 - January 2000-01-01T01:01:01-0500
Y: 105 - January 2005-01-01T01:01:01-0500
Y: 101 - January 0101-01-01T01:01:01-0500
Y: 105 - January 0105-01-01T01:01:01-0500
Y: 110 - January 0110-01-01T01:01:01-0500
Y: 1900 - January 1900-01-01T01:01:01-0500
Y: 1901 - January 1901-01-01T01:01:01-0500
Y: 1902 - January 1902-01-01T01:01:01-0500
Expand All @@ -47,7 +49,9 @@ Y: 70 - January 1970-01-01T01:01:01+0100
Y: 71 - January 1971-01-01T01:01:01+0100
Y: 99 - January 1999-01-01T01:01:01+0100
Y: 100 - January 2000-01-01T01:01:01+0100
Y: 105 - January 2005-01-01T01:01:01+0100
Y: 101 - January 0101-01-01T01:01:01+0100
Y: 105 - January 0105-01-01T01:01:01+0100
Y: 110 - January 0110-01-01T01:01:01+0100
Y: 1900 - January 1900-01-01T01:01:01+0100
Y: 1901 - January 1901-01-01T01:01:01+0100
Y: 1902 - January 1902-01-01T01:01:01+0100
Expand Down

0 comments on commit 7a28b87

Please sign in to comment.