summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2008-12-02 18:02:16 +0000
committerDerick Rethans <derick@php.net>2008-12-02 18:02:16 +0000
commit7a28b876e4c7c5d5ba40e34b8616ef6a8e31caf1 (patch)
tree883956a0ae1e67b73aa56f3562d58d0627d31263
parent1c3d2019b34930d978c84ebba24616b3ad5907d3 (diff)
downloadphp-git-7a28b876e4c7c5d5ba40e34b8616ef6a8e31caf1.tar.gz
- MFH: Fixed bug #46732 (mktime.year description is wrong).
-rw-r--r--ext/date/php_date.c2
-rw-r--r--ext/date/tests/mktime-3-64bit.phpt10
2 files changed, 8 insertions, 4 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index e69e0a409b..2cca079a31 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -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;
diff --git a/ext/date/tests/mktime-3-64bit.phpt b/ext/date/tests/mktime-3-64bit.phpt
index bb3fb2df74..a3649cd148 100644
--- a/ext/date/tests/mktime-3-64bit.phpt
+++ b/ext/date/tests/mktime-3-64bit.phpt
@@ -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";
@@ -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
@@ -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