- fix test on win, does not use putenv to set the TZ but date_default_timezone_set (should be the case on all platforms actually...)

This commit is contained in:
Pierre Joye 2011-09-04 21:40:22 +00:00
parent 40217d0417
commit d1b156f1be

View File

@ -3,14 +3,22 @@ date() function
--FILE-- --FILE--
<?php <?php
$tmp = "cr"; $tmp = "cr";
putenv ("TZ=GMT0"); if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
date_default_timezone_set('GMT0');
} else {
putenv ("TZ=GMT0");
}
for($a = 0;$a < strlen($tmp); $a++){ for($a = 0;$a < strlen($tmp); $a++){
echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n"; echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n";
} }
putenv ("TZ=MET"); if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
date_default_timezone_set("MET");
} else {
putenv ("TZ=MET");
}
for($a = 0;$a < strlen($tmp); $a++){ for($a = 0;$a < strlen($tmp); $a++){
echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n"; echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n";
} }