felipe Tue May 12 19:46:58 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/date/tests 002.phpt 009_win32.phpt bug13142.phpt bug14561.phpt bug17988.phpt bug20382-1.phpt bug20382-2.phpt bug21399.phpt bug21966.phpt bug26090.phpt bug26317.phpt bug26320.phpt bug26694.phpt bug27719.phpt bug27780.phpt bug28024.phpt bug29150.phpt bug30532.phpt bug32086.phpt bug32270.phpt bug32555.phpt bug32588.phpt bug33414-1.phpt bug33414-2.phpt bug33415-1.phpt bug33532.phpt bug35425.phpt date_default_timezone_get-3.phpt Log: - Fixed tests on Windows
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/002.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: php-src/ext/date/tests/002.phpt diff -u php-src/ext/date/tests/002.phpt:1.2 php-src/ext/date/tests/002.phpt:1.2.6.1 --- php-src/ext/date/tests/002.phpt:1.2 Thu Jun 16 18:13:40 2005 +++ php-src/ext/date/tests/002.phpt Tue May 12 19:46:58 2009 @@ -32,16 +32,16 @@ ); echo "*** GMT0\n"; - putenv ("TZ=GMT0"); + date_default_timezone_set("GMT0"); foreach ($dates as $date) { echo date ("Y-m-d H:i:s\n", strtotime ($date)); } echo "*** US/Eastern\n"; - putenv("TZ=US/Eastern"); + date_default_timezone_set("US/Eastern"); if( date("T") == "GMT" ) { // POSIX style - putenv ("TZ=EST5EDT4,M4.1.0,M10.5.0"); + date_default_timezone_set("EST5EDT4,M4.1.0,M10.5.0"); } foreach ($dates as $date) { http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/009_win32.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u Index: php-src/ext/date/tests/009_win32.phpt diff -u php-src/ext/date/tests/009_win32.phpt:1.1.2.3 php-src/ext/date/tests/009_win32.phpt:1.1.2.4 --- php-src/ext/date/tests/009_win32.phpt:1.1.2.3 Sat Jan 10 00:50:45 2009 +++ php-src/ext/date/tests/009_win32.phpt Tue May 12 19:46:58 2009 @@ -34,17 +34,17 @@ echo "Done\n"; ?> --EXPECTF-- -Warning: strftime() expects at least 1 parameter, 0 given in C:\Users\pierre\Documents\php-sdk\vc9\x86\php_5_3\ext\date\tests\009_win32.php on line 5 +Warning: strftime() expects at least 1 parameter, 0 given in %s on line %d bool(false) bool(false) -string(147) "Tue Tuesday Jun June 06/27/06 00:00:00 27 00 12 178 06 00 AM 00 26 26 2 06/27/06 00:00:00 06 2006 W. Europe Daylight Time W. Europe Daylight Time %" +string(%d) "Tue Tuesday Jun June 06/27/06 00:00:00 27 00 12 178 06 00 AM 00 26 26 2 06/27/06 00:00:00 06 2006 %s" string(5) "%q %a" string(4) "blah" -Warning: gmstrftime() expects at least 1 parameter, 0 given in C:\Users\pierre\Documents\php-sdk\vc9\x86\php_5_3\ext\date\tests\009_win32.php on line 15 +Warning: gmstrftime() expects at least 1 parameter, 0 given in %s on line %d bool(false) bool(false) -string(146) "Mon Monday Jun June 06/26/06 21:00:00 26 21 09 177 06 00 PM 00 26 26 1 06/26/06 21:00:00 06 2006 W. Europe Standard Time W. Europe Standard Time %" +string(%d) "Mon Monday Jun June 06/26/06 21:00:00 26 21 09 177 06 00 PM 00 26 26 1 06/26/06 21:00:00 06 2006 %s" string(5) "%q %a" string(4) "blah" Done http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug13142.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: php-src/ext/date/tests/bug13142.phpt diff -u php-src/ext/date/tests/bug13142.phpt:1.2 php-src/ext/date/tests/bug13142.phpt:1.2.6.1 --- php-src/ext/date/tests/bug13142.phpt:1.2 Thu Jun 16 18:13:40 2005 +++ php-src/ext/date/tests/bug13142.phpt Tue May 12 19:46:58 2009 @@ -1,5 +1,7 @@ --TEST-- Bug #13142 (strtotime handling of "M d H:i:s Y" format) +--INI-- +date.timezone=US/Eastern --SKIPIF-- <?php if (!...@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') { @@ -8,7 +10,7 @@ ?> --FILE-- <?php -putenv("TZ=US/Eastern"); + if (date('T') == 'GMT') { putenv("TZ=EST5EDT4,M4.1.0,M10.5.0"); } http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug14561.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: php-src/ext/date/tests/bug14561.phpt diff -u php-src/ext/date/tests/bug14561.phpt:1.1.2.1 php-src/ext/date/tests/bug14561.phpt:1.1.2.1.4.1 --- php-src/ext/date/tests/bug14561.phpt:1.1.2.1 Mon Jan 2 20:15:57 2006 +++ php-src/ext/date/tests/bug14561.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #14561 (strtotime() bug) +--INI-- +date.timezone=GMT --FILE-- <?php -putenv("TZ=GMT"); echo strtotime("19:30 Dec 17 2005"), "\n"; echo strtotime("Dec 17 19:30 2005"), "\n"; ?> http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug17988.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: php-src/ext/date/tests/bug17988.phpt diff -u php-src/ext/date/tests/bug17988.phpt:1.2 php-src/ext/date/tests/bug17988.phpt:1.2.6.1 --- php-src/ext/date/tests/bug17988.phpt:1.2 Thu Jun 16 18:13:40 2005 +++ php-src/ext/date/tests/bug17988.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #17988 (strtotime handling of postgresql timestamps) +--INI-- +date.timezone=GMT --FILE-- <?php -putenv("TZ=GMT"); echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728"))."\n"; echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 GMT"))."\n"; echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 MET"))."\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug20382-1.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: php-src/ext/date/tests/bug20382-1.phpt diff -u php-src/ext/date/tests/bug20382-1.phpt:1.1 php-src/ext/date/tests/bug20382-1.phpt:1.1.6.1 --- php-src/ext/date/tests/bug20382-1.phpt:1.1 Sun Jul 3 14:36:59 2005 +++ php-src/ext/date/tests/bug20382-1.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #20382 [1] (strtotime ("Monday", $date) produces wrong result on DST changeover) +--INI-- +date.timezone=Europe/Amsterdam --FILE-- <?php - putenv("TZ=Europe/Amsterdam"); $tStamp = mktime (17, 17, 17, 10, 27, 2004); echo "tStamp=". date("l Y-m-d H:i:s T", $tStamp). "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug20382-2.phpt?r1=1.2.2.1.2.1.2.1&r2=1.2.2.1.2.1.2.2&diff_format=u Index: php-src/ext/date/tests/bug20382-2.phpt diff -u php-src/ext/date/tests/bug20382-2.phpt:1.2.2.1.2.1.2.1 php-src/ext/date/tests/bug20382-2.phpt:1.2.2.1.2.1.2.2 --- php-src/ext/date/tests/bug20382-2.phpt:1.2.2.1.2.1.2.1 Thu Nov 8 11:39:40 2007 +++ php-src/ext/date/tests/bug20382-2.phpt Tue May 12 19:46:58 2009 @@ -32,7 +32,7 @@ ); foreach ($tests as $test) { - putenv("TZ={$test[0]}"); + date_default_timezone_set($test[0]); print "{$test[0]}\n"; array_shift($test); $timestamp = call_user_func_array('mktime', $test); http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug21399.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: php-src/ext/date/tests/bug21399.phpt diff -u php-src/ext/date/tests/bug21399.phpt:1.1 php-src/ext/date/tests/bug21399.phpt:1.1.6.1 --- php-src/ext/date/tests/bug21399.phpt:1.1 Mon Jun 20 08:47:56 2005 +++ php-src/ext/date/tests/bug21399.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #21399 (strtotime() request for "YYYYMMDDhhmmss [ZZZ]") +--INI-- +date.timezone=GMT --FILE-- <?php - putenv("TZ=GMT"); echo gmdate("Y-m-d H:i:s", strtotime("20050620091407 GMT")); ?> --EXPECT-- http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug21966.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: php-src/ext/date/tests/bug21966.phpt diff -u php-src/ext/date/tests/bug21966.phpt:1.1 php-src/ext/date/tests/bug21966.phpt:1.1.6.1 --- php-src/ext/date/tests/bug21966.phpt:1.1 Sun Jul 3 14:36:59 2005 +++ php-src/ext/date/tests/bug21966.phpt Tue May 12 19:46:58 2009 @@ -1,9 +1,9 @@ --TEST-- Bug #21966 (date() or mktime() returning bad value for mktime month param of '2') +--INI-- +date.timezone=Europe/London --FILE-- <?php -putenv("TZ=Europe/London"); - echo '27/3/04 = ' . strval(mktime(0,0,0,3,27,2004)) . "\n"; // 1080345600 echo '28/3/04 = ' . strval(mktime(0,0,0,3,28,2004)) . "\n"; // -3662 - should be 108043200 echo '28/3/04 = ' . strval(mktime(2,0,0,3,28,2004)) . "\n"; // 1080435600 http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug26090.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: php-src/ext/date/tests/bug26090.phpt diff -u php-src/ext/date/tests/bug26090.phpt:1.1 php-src/ext/date/tests/bug26090.phpt:1.1.6.1 --- php-src/ext/date/tests/bug26090.phpt:1.1 Tue Jun 28 21:49:35 2005 +++ php-src/ext/date/tests/bug26090.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #26090 (allow colons in time zone offset to strtotime()) +--INI-- +date.timezone=America/New_York --FILE-- <?php -putenv("TZ=America/New_York"); $t = '2003-10-28 10:20:30-0800'; echo date('Y-m-d H:i:s T', strtotime($t)) . "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug26317.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: php-src/ext/date/tests/bug26317.phpt diff -u php-src/ext/date/tests/bug26317.phpt:1.1.2.1 php-src/ext/date/tests/bug26317.phpt:1.1.2.1.4.1 --- php-src/ext/date/tests/bug26317.phpt:1.1.2.1 Tue Apr 25 22:09:46 2006 +++ php-src/ext/date/tests/bug26317.phpt Tue May 12 19:46:58 2009 @@ -1,12 +1,13 @@ --TEST-- Bug #26317 (military timezone offset signedness) +--INI-- +date.timezone=GMT0 --SKIPIF-- if (!...@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { die("skip unable to change TZ enviroment variable\n"); } --FILE-- <?php - putenv("TZ=GMT0"); echo date("Y-m-d H:i:s\n", strtotime("2003-11-19 16:20:42 Z")); echo date("Y-m-d H:i:s\n", strtotime("2003-11-19 09:20:42 T")); echo date("Y-m-d H:i:s\n", strtotime("2003-11-19 19:20:42 C")); http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug26320.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: php-src/ext/date/tests/bug26320.phpt diff -u php-src/ext/date/tests/bug26320.phpt:1.1.2.1 php-src/ext/date/tests/bug26320.phpt:1.1.2.1.4.1 --- php-src/ext/date/tests/bug26320.phpt:1.1.2.1 Tue Apr 25 22:09:46 2006 +++ php-src/ext/date/tests/bug26320.phpt Tue May 12 19:46:58 2009 @@ -1,12 +1,13 @@ --TEST-- Bug #26320 (strtotime handling of XML Schema/ISO 8601 format) +--INI-- +date.timezone=GMT0 --SKIPIF-- if (!...@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { die("skip unable to change TZ enviroment variable\n"); } --FILE-- <?php - putenv("TZ=GMT0"); echo date("Y-m-d H:i:s\n", strtotime("2003-11-19T12:30:42")); echo date("Y-m-d H:i:s\n", strtotime("2003-11-19T12:30:42Z")); ?> http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug26694.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: php-src/ext/date/tests/bug26694.phpt diff -u php-src/ext/date/tests/bug26694.phpt:1.1 php-src/ext/date/tests/bug26694.phpt:1.1.6.1 --- php-src/ext/date/tests/bug26694.phpt:1.1 Mon Jun 20 08:47:56 2005 +++ php-src/ext/date/tests/bug26694.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #26694 (strtotime() request for "Sun, 21 Dec 2003 20:38:33 +0000 GMT") +--INI-- +date.timezone=GMT --FILE-- <?php - putenv("TZ=GMT"); echo gmdate("Y-m-d H:i:s", strtotime("Sun, 21 Dec 2003 20:38:33 +0000 GMT")); ?> --EXPECT-- http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug27719.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: php-src/ext/date/tests/bug27719.phpt diff -u php-src/ext/date/tests/bug27719.phpt:1.1 php-src/ext/date/tests/bug27719.phpt:1.1.6.1 --- php-src/ext/date/tests/bug27719.phpt:1.1 Sun Jul 3 14:36:59 2005 +++ php-src/ext/date/tests/bug27719.phpt Tue May 12 19:46:58 2009 @@ -1,10 +1,10 @@ --TEST-- Bug #27719 (mktime returns incorrect timestamp for dst days) --INI-- +date.timezone=EST error_reporting=2047 --FILE-- -<?php /* $Id: bug27719.phpt,v 1.1 2005/07/03 14:36:59 derick Exp $ */ - putenv("TZ=EST"); // No DST +<?php /* $Id: bug27719.phpt,v 1.1.6.1 2009/05/12 19:46:58 felipe Exp $ */ $a = mktime(0, 0, 0, 4, 4, 2004, 0); $b = mktime(0, 0, 0, 4, 4, 2004, 1); $c = mktime(0, 0, 0, 4, 4, 2004, -1); @@ -12,7 +12,7 @@ echo "$b ".date("m/d/y h:i:s\n",$b); echo "$c ".date("m/d/y h:i:s\n",$c); echo "\n"; - putenv("TZ=EST5EDT"); // DST not in effect + date_default_timezone_set('EST5EDT'); // DST not in effect $a = mktime(0, 0, 0, 2, 4, 2004, 0); $b = mktime(0, 0, 0, 2, 4, 2004, 1); $c = mktime(0, 0, 0, 2, 4, 2004, -1); @@ -20,7 +20,7 @@ echo "$b ".date("m/d/y h:i:s\n",$b); echo "$c ".date("m/d/y h:i:s\n",$c); echo "\n"; - putenv("TZ=EST5EDT"); // Just before DST changeover + date_default_timezone_set('EST5EDT'); $a = mktime(0, 0, 0, 4, 4, 2004, 0); $b = mktime(0, 0, 0, 4, 4, 2004, 1); $c = mktime(0, 0, 0, 4, 4, 2004, -1); @@ -28,7 +28,7 @@ echo "$b ".date("m/d/y h:i:s\n",$b); echo "$c ".date("m/d/y h:i:s\n",$c); echo "\n"; - putenv("TZ=EST5EDT"); // Just after DST changeover + date_default_timezone_set('EST5EDT'); $a = mktime(3, 0, 0, 4, 4, 2004, 0); $b = mktime(3, 0, 0, 4, 4, 2004, 1); $c = mktime(3, 0, 0, 4, 4, 2004, -1); @@ -36,7 +36,7 @@ echo "$b ".date("m/d/y h:i:s\n",$b); echo "$c ".date("m/d/y h:i:s\n",$c); echo "\n"; - putenv("TZ=EST5EDT"); // DST in effect + date_default_timezone_set('EST5EDT'); $a = mktime(0, 0, 0, 6, 4, 2004, 0); $b = mktime(0, 0, 0, 6, 4, 2004, 1); $c = mktime(0, 0, 0, 6, 4, 2004, -1); http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug27780.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: php-src/ext/date/tests/bug27780.phpt diff -u php-src/ext/date/tests/bug27780.phpt:1.2 php-src/ext/date/tests/bug27780.phpt:1.2.6.1 --- php-src/ext/date/tests/bug27780.phpt:1.2 Sat Jun 18 11:15:29 2005 +++ php-src/ext/date/tests/bug27780.phpt Tue May 12 19:46:58 2009 @@ -24,7 +24,7 @@ ); foreach ($timezones as $timezone) { - putenv("TZ=$timezone"); + date_default_timezone_set($timezone); echo $timezone, "\n"; foreach ($timestrings as $timestring) { http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug28024.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: php-src/ext/date/tests/bug28024.phpt diff -u php-src/ext/date/tests/bug28024.phpt:1.1 php-src/ext/date/tests/bug28024.phpt:1.1.6.1 --- php-src/ext/date/tests/bug28024.phpt:1.1 Sat Jun 18 19:39:19 2005 +++ php-src/ext/date/tests/bug28024.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #28024 (Changed behavior of strtotime()) +--INI-- +date.timezone=Europe/Berlin --FILE-- <?php - putenv("TZ=Europe/Berlin"); echo strtotime("17:00 2004-01-01"), "\n"; echo date("Y-m-d H:i:s T", strtotime("17:00 2004-01-01")); ?> http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug29150.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: php-src/ext/date/tests/bug29150.phpt diff -u php-src/ext/date/tests/bug29150.phpt:1.1 php-src/ext/date/tests/bug29150.phpt:1.1.6.1 --- php-src/ext/date/tests/bug29150.phpt:1.1 Mon Jun 20 08:47:56 2005 +++ php-src/ext/date/tests/bug29150.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #29150 (Roman number format for months) +--INI-- +date.timezone=GMT --FILE-- <?php - putenv("TZ=GMT"); echo gmdate("Y-m-d H:i:s", strtotime("20 VI. 2005")); ?> --EXPECT-- http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug30532.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: php-src/ext/date/tests/bug30532.phpt diff -u php-src/ext/date/tests/bug30532.phpt:1.2 php-src/ext/date/tests/bug30532.phpt:1.2.6.1 --- php-src/ext/date/tests/bug30532.phpt:1.2 Fri Jun 17 22:45:31 2005 +++ php-src/ext/date/tests/bug30532.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,10 @@ --TEST-- Bug #30532 (strtotime - crossing daylight savings time) +--INI-- +date.timezone=America/New_York --FILE-- <?php -putenv("TZ=America/New_York"); + echo date('Y-m-d H:i:s T', strtotime('2004-10-31 EDT +1 hour'))."\n"; echo date('Y-m-d H:i:s T', strtotime('2004-10-31 EDT +2 hours'))."\n"; echo date('Y-m-d H:i:s T', strtotime('2004-10-31 EDT +3 hours'))."\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug32086.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: php-src/ext/date/tests/bug32086.phpt diff -u php-src/ext/date/tests/bug32086.phpt:1.2 php-src/ext/date/tests/bug32086.phpt:1.2.6.1 --- php-src/ext/date/tests/bug32086.phpt:1.2 Sat Jun 18 19:21:10 2005 +++ php-src/ext/date/tests/bug32086.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,10 @@ --TEST-- Bug #32086 (strtotime don't work in DST) +--INI-- +date.timezone=America/Sao_Paulo --FILE-- <?php -putenv("TZ=America/Sao_Paulo"); + echo $g = strtotime("2004-11-01"), "\n"; echo $i = strtotime("2004-11-01 +1 day"), "\n"; echo $j = strtotime("+1 day", $g), "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug32270.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: php-src/ext/date/tests/bug32270.phpt diff -u php-src/ext/date/tests/bug32270.phpt:1.2 php-src/ext/date/tests/bug32270.phpt:1.2.6.1 --- php-src/ext/date/tests/bug32270.phpt:1.2 Sat Jun 18 10:25:40 2005 +++ php-src/ext/date/tests/bug32270.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #32270 (strtotime/date behavior) +--INI-- +date.timezone=America/Los_Angeles --FILE-- <?php -putenv("TZ=America/Los_Angeles"); echo date("m/d/Y H:i:s T", -2145888000)."\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug32555.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: php-src/ext/date/tests/bug32555.phpt diff -u php-src/ext/date/tests/bug32555.phpt:1.2 php-src/ext/date/tests/bug32555.phpt:1.2.6.1 --- php-src/ext/date/tests/bug32555.phpt:1.2 Sat Jun 18 19:21:10 2005 +++ php-src/ext/date/tests/bug32555.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #32555 (strtotime("tomorrow") can return false) +--INI-- +date.timezone=US/Eastern --FILE-- <?php -putenv("TZ=US/Eastern"); $stamp = 1112427000; print strftime('%c %Z',strtotime('now',$stamp)) ."\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug32588.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: php-src/ext/date/tests/bug32588.phpt diff -u php-src/ext/date/tests/bug32588.phpt:1.1 php-src/ext/date/tests/bug32588.phpt:1.1.6.1 --- php-src/ext/date/tests/bug32588.phpt:1.1 Fri Jun 17 14:21:53 2005 +++ php-src/ext/date/tests/bug32588.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #32588 (strtotime() error for 'last xxx' DST problem) +--INI-- +date.timezone=America/New_York --FILE-- <?php -putenv("TZ=America/New_York"); echo date('D Y/m/d/H:i:s', strtotime('last saturday', 1112703348)). "\n"; echo date('D Y/m/d/H:i:s', strtotime("last sunday", 1112703348)). "\n"; http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug33414-1.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: php-src/ext/date/tests/bug33414-1.phpt diff -u php-src/ext/date/tests/bug33414-1.phpt:1.1.2.1 php-src/ext/date/tests/bug33414-1.phpt:1.1.2.1.4.1 --- php-src/ext/date/tests/bug33414-1.phpt:1.1.2.1 Wed Oct 19 21:08:35 2005 +++ php-src/ext/date/tests/bug33414-1.phpt Tue May 12 19:46:58 2009 @@ -1,10 +1,11 @@ --TEST-- Bug #33414 [1] (Comprehensive list of incorrect days returned after strotime() / date() tests) +--INI-- +date.timezone=America/Mendoza --FILE-- <?php print "TZ=America/Mendoza - wrong day.\n"; -putenv("TZ=America/Mendoza"); $tStamp = mktime (17, 17, 17, 1, 8327, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Sunday", $tStamp); @@ -12,7 +13,7 @@ print "wanted=Sunday 00:00:00\n\n"; print "TZ=America/Catamarca - wrong day.\n"; -putenv("TZ=America/Catamarca"); +date_default_timezone_set("America/Catamarca"); $tStamp = mktime (17, 17, 17, 1, 7599, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Sunday", $tStamp); @@ -20,7 +21,7 @@ print "wanted=Sunday 00:00:00\n\n"; print "TZ=America/Cordoba - wrong day.\n"; -putenv("TZ=America/Cordoba"); +date_default_timezone_set("America/Cordoba"); $tStamp = mktime (17, 17, 17, 1, 7599, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Sunday", $tStamp); @@ -28,7 +29,7 @@ print "wanted=Sunday 00:00:00\n\n"; print "TZ=America/Rosario - wrong day.\n"; -putenv("TZ=America/Rosario"); +date_default_timezone_set("America/Rosario"); $tStamp = mktime (17, 17, 17, 1, 7958, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Tuesday", $tStamp); @@ -37,7 +38,7 @@ print "TZ=Europe/Vienna - wrong day - giving unexpected results, at least on my system :-)\n"; -putenv("TZ=Europe/Vienna"); +date_default_timezone_set("Europe/Vienna"); $tStamp = mktime (17, 17, 17, 1, 3746, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -45,7 +46,7 @@ print "wanted=Thursday 00:00:00\n\n"; print "TZ=Asia/Baku - wrong day.\n"; -putenv("TZ=Asia/Baku"); +date_default_timezone_set("Asia/Baku"); $tStamp = mktime (17, 17, 17, 1, 8299, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Sunday", $tStamp); @@ -53,7 +54,7 @@ print "wanted=Sunday 00:00:00\n\n"; print "TZ=America/Noronha - wrong day.\n"; -putenv("TZ=America/Noronha"); +date_default_timezone_set("America/Noronha"); $tStamp = mktime (17, 17, 17, 1, 10866, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Friday", $tStamp); @@ -61,7 +62,7 @@ print "wanted=Friday 00:00:00\n\n"; print "TZ=America/Havana - wrong day.\n"; -putenv("TZ=America/Havana"); +date_default_timezone_set("America/Havana"); $tStamp = mktime (17, 17, 17, 1, 12720, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -69,7 +70,7 @@ print "wanted=Thursday 00:00:00\n\n"; print "TZ=Europe/Tallinn - wrong day.\n"; -putenv("TZ=Europe/Tallinn"); +date_default_timezone_set("Europe/Tallinn"); $tStamp = mktime (17, 17, 17, 1, 11777, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Saturday", $tStamp); @@ -77,7 +78,7 @@ print "wanted=Saturday 00:00:00\n\n"; print "TZ=Asia/Jerusalem - wrong day.\n"; -putenv("TZ=Asia/Jerusalem"); +date_default_timezone_set("Asia/Jerusalem"); $tStamp = mktime (17, 17, 17, 1, 13056, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -85,7 +86,7 @@ print "wanted=Thursday 00:00:00\n\n"; print "TZ=Europe/Vilnius - wrong day.\n"; -putenv("TZ=Europe/Vilnius"); +date_default_timezone_set("Europe/Vilnius"); $tStamp = mktime (17, 17, 17, 1, 12140, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Friday", $tStamp); @@ -93,7 +94,7 @@ print "wanted=Friday 00:00:00\n\n"; print "TZ=Pacific/Kwajalein - wrong day.\n"; -putenv("TZ=Pacific/Kwajalein"); +date_default_timezone_set("Pacific/Kwajalein"); $tStamp = mktime (17, 17, 17, 1, 8626, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Friday", $tStamp); @@ -101,7 +102,7 @@ print "wanted=Friday 00:00:00\n\n"; print "TZ=Asia/Ulan_Bator - wrong day.\n"; -putenv("TZ=Asia/Ulan_Bator"); +date_default_timezone_set("Asia/Ulan_Bator"); $tStamp = mktime (17, 17, 17, 1, 11588, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Saturday", $tStamp); @@ -109,7 +110,7 @@ print "wanted=Saturday 00:00:00\n\n"; print "TZ=America/Cancun - wrong day.\n"; -putenv("TZ=America/Cancun"); +date_default_timezone_set("America/Cancun"); $tStamp = mktime (17, 17, 17, 1, 11785, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Sunday", $tStamp); @@ -117,7 +118,7 @@ print "wanted=Sunday 00:00:00\n\n"; print "TZ=America/Mexico_City - wrong day.\n"; -putenv("TZ=America/Mexico_City"); +date_default_timezone_set("America/Mexico_City"); $tStamp = mktime (17, 17, 17, 1, 11781, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Wednesday", $tStamp); @@ -125,7 +126,7 @@ print "wanted=Wednesday 00:00:00\n\n"; print "TZ=America/Mazatlan - wrong day.\n"; -putenv("TZ=America/Mazatlan"); +date_default_timezone_set("America/Mazatlan"); $tStamp = mktime (17, 17, 17, 1, 11780, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Tuesday", $tStamp); @@ -133,7 +134,7 @@ print "wanted=Tuesday 00:00:00\n\n"; print "TZ=America/Chihuahua - wrong day.\n"; -putenv("TZ=America/Chihuahua"); +date_default_timezone_set("America/Chihuahua"); $tStamp = mktime (17, 17, 17, 1, 11782, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -141,7 +142,7 @@ print "wanted=Thursday 00:00:00\n\n"; print "TZ=Asia/Kuala_Lumpur - wrong day.\n"; -putenv("TZ=Asia/Kuala_Lumpur"); +date_default_timezone_set("Asia/Kuala_Lumpur"); $tStamp = mktime (17, 17, 17, 1, 4380, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Monday", $tStamp); @@ -149,7 +150,7 @@ print "wanted=Monday 00:00:00\n\n"; print "TZ=Pacific/Chatham - wrong day.\n"; -putenv("TZ=Pacific/Chatham"); +date_default_timezone_set("Pacific/Chatham"); $tStamp = mktime (17, 17, 17, 1, 1762, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Monday", $tStamp); @@ -157,7 +158,7 @@ print "wanted=Monday 00:00:00\n\n"; print "TZ=America/Lima - wrong day.\n"; -putenv("TZ=America/Lima"); +date_default_timezone_set("America/Lima"); $tStamp = mktime (17, 17, 17, 1, 5839, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -165,7 +166,7 @@ print "wanted=Thursday 00:00:00\n\n"; print "TZ=Asia/Karachi - wrong day.\n"; -putenv("TZ=Asia/Karachi"); +date_default_timezone_set("Asia/Karachi"); $tStamp = mktime (17, 17, 17, 1, 11783, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Friday", $tStamp); @@ -173,7 +174,7 @@ print "wanted=Friday 00:00:00\n\n"; print "TZ=America/Asuncion - wrong day.\n"; -putenv("TZ=America/Asuncion"); +date_default_timezone_set("America/Asuncion"); $tStamp = mktime (17, 17, 17, 1, 11746, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Wednesday", $tStamp); @@ -181,7 +182,7 @@ print "wanted=Wednesday 00:00:00\n\n"; print "TZ=Asia/Singapore - wrong day.\n"; -putenv("TZ=Asia/Singapore"); +date_default_timezone_set("Asia/Singapore"); $tStamp = mktime (17, 17, 17, 1, 4383, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -189,7 +190,7 @@ print "wanted=Thursday 00:00:00\n\n"; print "TZ=America/Montevideo - wrong day.\n"; -putenv("TZ=America/Montevideo"); +date_default_timezone_set("America/Montevideo"); $tStamp = mktime (17, 17, 17, 1, 12678, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug33414-2.phpt?r1=1.2.2.3&r2=1.2.2.3.4.1&diff_format=u Index: php-src/ext/date/tests/bug33414-2.phpt diff -u php-src/ext/date/tests/bug33414-2.phpt:1.2.2.3 php-src/ext/date/tests/bug33414-2.phpt:1.2.2.3.4.1 --- php-src/ext/date/tests/bug33414-2.phpt:1.2.2.3 Wed Oct 19 21:08:35 2005 +++ php-src/ext/date/tests/bug33414-2.phpt Tue May 12 19:46:58 2009 @@ -3,7 +3,7 @@ --FILE-- <?php print "TZ=Pacific/Rarotonga - wrong day.\n"; -putenv("TZ=Pacific/Rarotonga"); +date_default_timezone_set("Pacific/Rarotonga"); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Tuesday", $tStamp); @@ -11,7 +11,7 @@ print "wanted=Tuesday 00:00:00\n\n"; print "TZ=Atlantic/South_Georgia - wrong day.\n"; -putenv("TZ=Atlantic/South_Georgia"); +date_default_timezone_set("Atlantic/South_Georgia"); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Tuesday", $tStamp); @@ -19,7 +19,7 @@ print "wanted=Tuesday 00:00:00\n\n"; print "TZ=America/Port-au-Prince - wrong day.\n"; -putenv("TZ=America/Port-au-Prince"); +date_default_timezone_set("America/Port-au-Prince"); $tStamp = mktime (17, 17, 17, 1, 12871, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Monday", $tStamp); @@ -27,7 +27,7 @@ print "wanted=Monday 00:00:00\n\n"; print "TZ=Pacific/Enderbury - wrong day, off by 2 days.\n"; -putenv("TZ=Pacific/Enderbury"); +date_default_timezone_set("Pacific/Enderbury"); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Monday", $tStamp); @@ -35,7 +35,7 @@ print "wanted=Monday 00:00:00\n\n"; print "TZ=Pacific/Kiritimati - wrong day, off by 2 days.\n"; -putenv("TZ=Pacific/Kiritimati"); +date_default_timezone_set("Pacific/Kiritimati"); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Monday", $tStamp); @@ -43,7 +43,7 @@ print "wanted=Monday 00:00:00\n\n"; print "TZ=America/Managua - wrong day.\n"; -putenv("TZ=America/Managua"); +date_default_timezone_set("America/Managua"); $tStamp = mktime (17, 17, 17, 1, 12879, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Tuesday", $tStamp); @@ -51,7 +51,7 @@ print "wanted=Tuesday 00:00:00\n\n"; print "TZ=Pacific/Pitcairn - wrong day.\n"; -putenv("TZ=Pacific/Pitcairn"); +date_default_timezone_set("Pacific/Pitcairn"); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Wednesday", $tStamp); @@ -59,7 +59,7 @@ print "wanted=Wednesday 00:00:00\n\n"; print "TZ=Pacific/Fakaofo - wrong day.\n"; -putenv("TZ=Pacific/Fakaofo"); +date_default_timezone_set("Pacific/Fakaofo"); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Saturday", $tStamp); @@ -67,7 +67,7 @@ print "wanted=Saturday 00:00:00\n\n"; print "TZ=Pacific/Johnston - wrong day.\n"; -putenv("TZ=Pacific/Johnston"); +date_default_timezone_set("Pacific/Johnston"); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Friday", $tStamp); http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug33415-1.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: php-src/ext/date/tests/bug33415-1.phpt diff -u php-src/ext/date/tests/bug33415-1.phpt:1.1.2.1 php-src/ext/date/tests/bug33415-1.phpt:1.1.2.1.4.1 --- php-src/ext/date/tests/bug33415-1.phpt:1.1.2.1 Wed Oct 19 21:08:35 2005 +++ php-src/ext/date/tests/bug33415-1.phpt Tue May 12 19:46:58 2009 @@ -5,7 +5,7 @@ print "TZ=America/Jujuy - Is it OK for this to be 2 AM, rather than 1 AM as per most DST transitions?\n"; -putenv("TZ=America/Jujuy"); +date_default_timezone_set("America/Jujuy"); $tStamp = mktime (17, 17, 17, 1, 7593, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Monday", $tStamp); @@ -13,7 +13,7 @@ print "wanted=Monday 00:00:00\n\n"; print "TZ=Asia/Tbilisi - Is it OK for this to be 2 AM?\n"; -putenv("TZ=Asia/Tbilisi"); +date_default_timezone_set("Asia/Tbilisi"); $tStamp = mktime (17, 17, 17, 1, 12863, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Sunday", $tStamp); http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug33532.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: php-src/ext/date/tests/bug33532.phpt diff -u php-src/ext/date/tests/bug33532.phpt:1.2 php-src/ext/date/tests/bug33532.phpt:1.2.6.1 --- php-src/ext/date/tests/bug33532.phpt:1.2 Tue Aug 2 21:16:05 2005 +++ php-src/ext/date/tests/bug33532.phpt Tue May 12 19:46:58 2009 @@ -5,7 +5,7 @@ date.timezone=UTC --FILE-- <?php -putenv("TZ="); + setlocale(LC_ALL, 'C'); print "TZ has NOT been set\n"; @@ -17,7 +17,7 @@ print "datestr " . date ("H:i:s A F j Y T", $tStamp) . "\n"; print "\nSetting TZ\n"; -putenv("TZ=Australia/Sydney"); +date_default_timezone_set('Australia/Sydney'); $input = "10:00:00 AM July 1 2005"; print "input " . $input . "\n"; $tStamp = strtotime($input); http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug35425.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: php-src/ext/date/tests/bug35425.phpt diff -u php-src/ext/date/tests/bug35425.phpt:1.1.2.1 php-src/ext/date/tests/bug35425.phpt:1.1.2.1.4.1 --- php-src/ext/date/tests/bug35425.phpt:1.1.2.1 Tue Nov 29 20:19:56 2005 +++ php-src/ext/date/tests/bug35425.phpt Tue May 12 19:46:58 2009 @@ -1,8 +1,9 @@ --TEST-- Bug #35425 (idate() function ignores timezone settings) +--INI-- +date.timezone=America/Montreal --FILE-- <?php -putenv('TZ=America/Montreal'); $time = mktime(1,1,1,1,1,2005); foreach (array('B','d','h','H','i','I','L','m','s','t','U','w','W','y','Y','z','Z') as $v) { http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/date_default_timezone_get-3.phpt?r1=1.1.6.2&r2=1.1.6.3&diff_format=u Index: php-src/ext/date/tests/date_default_timezone_get-3.phpt diff -u php-src/ext/date/tests/date_default_timezone_get-3.phpt:1.1.6.2 php-src/ext/date/tests/date_default_timezone_get-3.phpt:1.1.6.3 --- php-src/ext/date/tests/date_default_timezone_get-3.phpt:1.1.6.2 Tue Jan 27 14:16:15 2009 +++ php-src/ext/date/tests/date_default_timezone_get-3.phpt Tue May 12 19:46:58 2009 @@ -1,10 +1,9 @@ --TEST-- date_default_timezone_get() function [3] --INI-- -date.timezone= +date.timezone=Europe/Rome --FILE-- <?php - putenv('TZ=Europe/Rome'); echo date_default_timezone_get(), "\n"; date_default_timezone_set("America/Chicago");
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php