]> granicus.if.org Git - php/commitdiff
- Fixed tests
authorFelipe Pena <felipe@php.net>
Sat, 10 Oct 2009 00:31:18 +0000 (00:31 +0000)
committerFelipe Pena <felipe@php.net>
Sat, 10 Oct 2009 00:31:18 +0000 (00:31 +0000)
31 files changed:
ext/date/tests/DateTime_format_variation1.phpt
ext/date/tests/bug13142.phpt
ext/date/tests/bug14561.phpt
ext/date/tests/bug17988.phpt
ext/date/tests/bug20382-1.phpt
ext/date/tests/bug20382-2.phpt
ext/date/tests/bug21399.phpt
ext/date/tests/bug21966.phpt
ext/date/tests/bug26090.phpt
ext/date/tests/bug26317.phpt
ext/date/tests/bug26320.phpt
ext/date/tests/bug26694.phpt
ext/date/tests/bug27719.phpt
ext/date/tests/bug27780.phpt
ext/date/tests/bug28024.phpt
ext/date/tests/bug28088.phpt
ext/date/tests/bug29150.phpt
ext/date/tests/bug30532.phpt
ext/date/tests/bug32086.phpt
ext/date/tests/bug32270.phpt
ext/date/tests/bug32555.phpt
ext/date/tests/bug32588.phpt
ext/date/tests/bug33414-1.phpt
ext/date/tests/bug33414-2.phpt
ext/date/tests/bug33415-1.phpt
ext/date/tests/bug33415-2.phpt
ext/date/tests/bug33532.phpt
ext/date/tests/bug35425.phpt
ext/date/tests/mktime-2.phpt
ext/date/tests/timezone-configuration.phpt
tests/func/ini_alter.phpt

index 87a99220a601658f8f542bb674f37ac2c2749168..46e98c73cfb2c8fedf9aa8060063639d3461dcf6 100644 (file)
@@ -111,98 +111,98 @@ fclose( $file_handle );
 *** Testing DateTime::format() : usage variation -  unexpected values to first argument $format***
 
 -- int 0 --
-string(1) "0"
+unicode(1) "0"
 
 -- int 1 --
-string(1) "1"
+unicode(1) "1"
 
 -- int 12345 --
-string(5) "12345"
+unicode(5) "12345"
 
 -- int -12345 --
-string(6) "-12345"
+unicode(6) "-12345"
 
 -- float 10.5 --
-string(4) "10.5"
+unicode(4) "10.5"
 
 -- float -10.5 --
-string(5) "-10.5"
+unicode(5) "-10.5"
 
 -- float .5 --
-string(3) "0.5"
+unicode(3) "0.5"
 
 -- empty array --
 
-Warning: DateTime::format() expects parameter 1 to be string, array given in %s on line %d
+Warning: DateTime::format() expects parameter 1 to be binary string, array given in %s on line %d
 bool(false)
 
 -- int indexed array --
 
-Warning: DateTime::format() expects parameter 1 to be string, array given in %s on line %d
+Warning: DateTime::format() expects parameter 1 to be binary string, array given in %s on line %d
 bool(false)
 
 -- associative array --
 
-Warning: DateTime::format() expects parameter 1 to be string, array given in %s on line %d
+Warning: DateTime::format() expects parameter 1 to be binary string, array given in %s on line %d
 bool(false)
 
 -- nested arrays --
 
-Warning: DateTime::format() expects parameter 1 to be string, array given in %s on line %d
+Warning: DateTime::format() expects parameter 1 to be binary string, array given in %s on line %d
 bool(false)
 
 -- uppercase NULL --
-string(0) ""
+unicode(0) ""
 
 -- lowercase null --
-string(0) ""
+unicode(0) ""
 
 -- lowercase true --
-string(1) "1"
+unicode(1) "1"
 
 -- lowercase false --
-string(0) ""
+unicode(0) ""
 
 -- uppercase TRUE --
-string(1) "1"
+unicode(1) "1"
 
 -- uppercase FALSE --
-string(0) ""
+unicode(0) ""
 
 -- empty string DQ --
-string(0) ""
+unicode(0) ""
 
 -- empty string SQ --
-string(0) ""
+unicode(0) ""
 
 -- string DQ --
-string(40) "4131Thu, 14 Jul 2005 22:30:41 +010030710"
+unicode(40) "4131Thu, 14 Jul 2005 22:30:41 +010030710"
 
 -- string SQ --
-string(40) "4131Thu, 14 Jul 2005 22:30:41 +010030710"
+unicode(40) "4131Thu, 14 Jul 2005 22:30:41 +010030710"
 
 -- mixed case string --
-string(40) "41BSTThu, 14 Jul 2005 22:30:41 +01001722"
+unicode(40) "41BSTThu, 14 Jul 2005 22:30:41 +01001722"
 
 -- heredoc --
-string(82) "10Europe/LondonThursdayThursday2005 42005Thu, 14 Jul 2005 22:30:41 +0100Thursday14"
+unicode(82) "10Europe/LondonThursdayThursday2005 42005Thu, 14 Jul 2005 22:30:41 +0100Thursday14"
 
 -- instance of classWithToString --
-string(66) "CThursdaypm4141 PM 2005b14Europe/London2005-07-14T22:30:41+01:0031"
+unicode(66) "CThursdaypm4141 PM 2005b14Europe/London2005-07-14T22:30:41+01:0031"
 
 -- instance of classWithoutToString --
 
-Warning: DateTime::format() expects parameter 1 to be string, object given in %s on line %d
+Warning: DateTime::format() expects parameter 1 to be binary string, object given in %s on line %d
 bool(false)
 
 -- undefined var --
-string(0) ""
+unicode(0) ""
 
 -- unset var --
-string(0) ""
+unicode(0) ""
 
 -- resource --
 
-Warning: DateTime::format() expects parameter 1 to be string, resource given in %s on line %d
+Warning: DateTime::format() expects parameter 1 to be binary string, resource given in %s on line %d
 bool(false)
 ===DONE===
index 5e54263c5493290c90bb6b51fadf07ae24a67242..a392117ddd52d1850adb9751126153cf17fda89c 100644 (file)
@@ -8,7 +8,7 @@ if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') {
 ?>
 --FILE--
 <?php
-putenv("TZ=US/Eastern");
+date_default_timezone_set('US/Eastern');
 if (date('T') == 'GMT') {
        putenv("TZ=EST5EDT4,M4.1.0,M10.5.0");
 }
index 98638c3e4b525429bd1fb9c1b0a69107d5968ead..3632737a37dcb4a5f650344cbf222d1cb17e6124 100644 (file)
@@ -2,7 +2,7 @@
 Bug #14561 (strtotime() bug)
 --FILE--
 <?php
-putenv("TZ=GMT");
+date_default_timezone_set('GMT');
 echo strtotime("19:30 Dec 17 2005"), "\n";
 echo strtotime("Dec 17 19:30 2005"), "\n";
 ?>
index 259fa7dc2e3bdc6635204c269ff73a10d1c91ee7..71ddff0b5f25ff9763885925a0e49a630fd0e917 100644 (file)
@@ -2,7 +2,7 @@
 Bug #17988 (strtotime handling of postgresql timestamps)
 --FILE--
 <?php
-putenv("TZ=GMT");
+date_default_timezone_set('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";
index a259d934af1d6959bbc14425e860beaa0b578748..798ca8625b5195777f2a231e1df612ba4da74dff 100644 (file)
@@ -2,7 +2,7 @@
 Bug #20382 [1] (strtotime ("Monday", $date) produces wrong result on DST changeover)
 --FILE--
 <?php
-       putenv("TZ=Europe/Amsterdam");
+       date_default_timezone_set('Europe/Amsterdam');
        $tStamp = mktime (17, 17, 17, 10, 27, 2004);
        echo "tStamp=". date("l Y-m-d H:i:s T", $tStamp). "\n";
        
index 2026ed44da41505bf3b83f503c3fa4f06bf95b31..e1f8369d2a1297438a064894517ab73d411991af 100644 (file)
@@ -32,7 +32,7 @@ $tests = array(
 );
 
 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);
index 08040bec5430742aed44d86030c5ee2ca8663625..6407e4afdfdea3c575ab2fb7fa3238c972f9983f 100644 (file)
@@ -2,7 +2,7 @@
 Bug #21399 (strtotime() request for "YYYYMMDDhhmmss [ZZZ]")
 --FILE--
 <?php
-       putenv("TZ=GMT");
+       date_default_timezone_set('GMT');
        echo gmdate("Y-m-d H:i:s", strtotime("20050620091407 GMT"));
 ?>
 --EXPECT--
index 31f592fa98407fce6e09fd7b5edcc95045ba2599..36ce75dd48af9e37f5a39583e5cd79fdd98b5a9e 100644 (file)
@@ -2,7 +2,7 @@
 Bug #21966 (date() or mktime() returning bad value for mktime month param of '2')
 --FILE--
 <?php
-putenv("TZ=Europe/London");
+date_default_timezone_set('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
index 03a90352cc09214b04f5d37de0d3d26efae967bf..f2a4e8060da30c7f846128004443ac580a5b0b98 100644 (file)
@@ -2,7 +2,7 @@
 Bug #26090 (allow colons in time zone offset to strtotime())
 --FILE--
 <?php
-putenv("TZ=America/New_York");
+date_default_timezone_set('America/New_York');
 $t = '2003-10-28 10:20:30-0800';
 echo date('Y-m-d H:i:s T', strtotime($t)) . "\n";
 
index aef29035e2a9178b177df13e7e5f3bed97a41c0a..6d21df17970607b7b1681f52aded908058ed0192 100644 (file)
@@ -1,12 +1,8 @@
 --TEST--
 Bug #26317 (military timezone offset signedness)
---SKIPIF--
-if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
-       die("skip unable to change TZ enviroment variable\n");
-}
 --FILE--
 <?php
-    putenv("TZ=GMT0");
+    date_default_timezone_set('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"));
index 5b237cadbf1cb8210a1062084a73794a850bc2ef..a3a1bf66f7691a32f2bf62a9858afe0dfa74c07a 100644 (file)
@@ -1,12 +1,8 @@
 --TEST--
 Bug #26320 (strtotime handling of XML Schema/ISO 8601 format)
---SKIPIF--
-if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
-       die("skip unable to change TZ enviroment variable\n");
-}
 --FILE--
 <?php
-    putenv("TZ=GMT0");
+    date_default_timezone_set('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"));
 ?>
index a709d1666c3351b9934039975b54760e0e073edc..32cf09f1f89c10552981d5f3352567a66d35353c 100644 (file)
@@ -2,7 +2,7 @@
 Bug #26694 (strtotime() request for "Sun, 21 Dec 2003 20:38:33 +0000 GMT")
 --FILE--
 <?php
-       putenv("TZ=GMT");
+       date_default_timezone_set('GMT');
        echo gmdate("Y-m-d H:i:s", strtotime("Sun, 21 Dec 2003 20:38:33 +0000 GMT"));
 ?>
 --EXPECT--
index 6f65bfb85e0a2699520ef322b6d930d32e311470..796601983f612a979255ecae3b9e31e3e674c114 100644 (file)
@@ -3,8 +3,8 @@ Bug #27719 (mktime returns incorrect timestamp for dst days)
 --INI--
 error_reporting=2047
 --FILE--
-<?php /* $Id$ */
-       putenv("TZ=EST");  // No DST
+<?php
+       date_default_timezone_set('EST');  // No DST
        $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 @@ error_reporting=2047
        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 @@ error_reporting=2047
        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');  // Just before DST changeover
        $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 @@ error_reporting=2047
        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');  // Just after DST changeover
        $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 @@ error_reporting=2047
        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');  // DST in effect
        $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);
index f1e6eb67bd9e9a155c4f52806651d5c7900b41b5..bd3bc949bd2b9b6c0ec0653468ff865324b01c10 100644 (file)
@@ -24,7 +24,7 @@ $timestrings = array (
 );
 
 foreach ($timezones as $timezone) {
-       putenv("TZ=$timezone");
+       date_default_timezone_set($timezone);
        echo $timezone, "\n";
 
        foreach ($timestrings as $timestring) {
index 3e0399adbed3be6009a8628ed52df9b5c32dcedc..3dc72abe811f2bf61cc7a3e97a7e2c05fbb6c481 100644 (file)
@@ -2,7 +2,7 @@
 Bug #28024 (Changed behavior of strtotime())
 --FILE--
 <?php
-       putenv("TZ=Europe/Berlin");
+       date_default_timezone_set('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"));
 ?>
index 95866e00be4610c6bb1bd180ec2fa53413e7da46..d9c18b4cc7cc4a99049ee2908c53857458b75b73 100644 (file)
@@ -2,7 +2,7 @@
 Bug #28088 (strtotime() cannot convert 00 hours")
 --FILE--
 <?php
-putenv("TZ=GMT");
+date_default_timezone_set('GMT');
 
 echo "The following line rightly shows the correct date time:\n";
 echo gmdate("m/d/y Hi", strtotime("04/04/04 2345")), "\n";
index 274584d050842f4216f5f227fb4209f685951752..4d9906a0517f06f4de19380d45e60b0de316db7b 100644 (file)
@@ -2,7 +2,7 @@
 Bug #29150 (Roman number format for months)
 --FILE--
 <?php
-       putenv("TZ=GMT");
+       date_default_timezone_set('GMT');
        echo gmdate("Y-m-d H:i:s", strtotime("20 VI. 2005"));
 ?>
 --EXPECT--
index faee0b316f32c2fcb8d71212a80b08b304aab628..a9045336ad13746dc2a08349feda93b6c8a3ce43 100644 (file)
@@ -2,7 +2,7 @@
 Bug #30532 (strtotime - crossing daylight savings time)
 --FILE--
 <?php
-putenv("TZ=America/New_York");
+date_default_timezone_set('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";
index 2799164cb1842a5e496957d62b149f389bf88418..25795de3f5f2c25d5b4af1fe9b65e8c4a366fc94 100644 (file)
@@ -2,7 +2,7 @@
 Bug #32086 (strtotime don't work in DST)
 --FILE--
 <?php
-putenv("TZ=America/Sao_Paulo");
+date_default_timezone_set('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";
index 2c5ff4754980315cae5ef978687173c2d3354da1..7112c7bbf398908eb0833c2370187782c3671058 100644 (file)
@@ -2,7 +2,7 @@
 Bug #32270 (strtotime/date behavior)
 --FILE--
 <?php
-putenv("TZ=America/Los_Angeles");
+date_default_timezone_set('America/Los_Angeles');
 
 echo date("m/d/Y H:i:s T", -2145888000)."\n";
 
index 3ef513b5e902f00fc3e93cc6408527e7209faf5e..d6e38ebaa1e69e41d0b05e0d7676ac4c9efe302b 100644 (file)
@@ -2,7 +2,7 @@
 Bug #32555 (strtotime("tomorrow") can return false)
 --FILE--
 <?php
-putenv("TZ=US/Eastern");
+date_default_timezone_set('US/Eastern');
 
 $stamp = 1112427000;
 print strftime('%c %Z',strtotime('now',$stamp)) ."\n";
index 6cf5ac92f85ff7b1665c0180815982be8101d95e..fa5ba91142a903ae8f96eb4dfaaca1fe8742a255 100644 (file)
@@ -2,7 +2,7 @@
 Bug #32588 (strtotime() error for 'last xxx' DST problem)
 --FILE--
 <?php
-putenv("TZ=America/New_York");
+date_default_timezone_set('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";
index 7b15228cf348b1df22200ec0d3b629b335862138..c1faaaa0a07f94d40fe6ecaa9e75ef20cc904f02 100644 (file)
@@ -4,7 +4,7 @@ Bug #33414 [1] (Comprehensive list of incorrect days returned after strotime() /
 <?php 
 
 print "TZ=America/Mendoza - wrong day.\n";
-putenv("TZ=America/Mendoza");
+date_default_timezone_set('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 +12,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +20,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +28,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +37,7 @@ print "wanted=Tuesday           00:00:00\n\n";
 
 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 +45,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +53,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +61,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +69,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +77,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +85,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +93,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +101,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +109,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +117,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +125,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +133,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +141,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +149,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +157,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +165,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +173,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +181,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 +189,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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);
index 8eb2a3569722746a313b4394320d058b88806146..d7537f4b26d8b256d35db6023f7d3eef2a208a9e 100644 (file)
@@ -3,7 +3,7 @@ Bug #33414 [2] (Comprehensive list of incorrect days returned after strotime() /
 --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 "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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 "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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);
index 3d36af8a53329e42b0502d8adeff81a0e9e377ae..48e895fde933eb23095852d05bb0c35831a0ee65 100644 (file)
@@ -5,7 +5,7 @@ Bug #33415 [1] (Possibly invalid non-one-hour DST or timezone shifts)
 
 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 "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 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);
index a1e5930b5ff52b40c09363426431b63618143af7..ef96a0e9b8cd9bcf5578f1d783af6d7531a14d7e 100644 (file)
@@ -5,7 +5,7 @@ Bug #33415 [2] (Possibly invalid non-one-hour DST or timezone shifts)
 
 print "TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
 have a DST or timezone transition.\n";
-putenv("TZ=Africa/Bujumbura");
+date_default_timezone_set('Africa/Bujumbura');
 $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);
@@ -13,7 +13,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Wednesday            00:00:00\n\n";
 
 print "TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes\n";
-putenv("TZ=Asia/Thimbu");
+date_default_timezone_set('Asia/Thimbu');
 $tStamp = mktime (17, 17, 17, 1, 6476, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -22,7 +22,7 @@ print "wanted=Thursday            00:30:00\n\n";
 
 print "TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
 appear to have a DST or timezone transition.\n";
-putenv("TZ=Indian/Cocos");
+date_default_timezone_set('Indian/Cocos');
 $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 Thursday", $tStamp);
@@ -31,7 +31,7 @@ print "wanted=Thursday            00:00:00\n\n";
 
 print "TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
 not appear to have a DST or timezone transition.\n";
-putenv("TZ=Africa/Lubumbashi");
+date_default_timezone_set('Africa/Lubumbashi');
 $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);
@@ -39,7 +39,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Saturday            00:00:00\n\n";
 
 print "TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes\n";
-putenv("TZ=Asia/Kashgar");
+date_default_timezone_set('Asia/Kashgar');
 $tStamp = mktime (17, 17, 17, 1, 3767, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -48,7 +48,7 @@ print "wanted=Thursday            03:00:00\n\n";
 
 print "TZ=Indian/Christmas - Is it OK for this to be 7 AM?  Note: does
 not appear to have a DST or timezone transition.\n";
-putenv("TZ=Indian/Christmas");
+date_default_timezone_set('Indian/Christmas');
 $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 Sunday", $tStamp);
@@ -56,7 +56,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Sunday            00:00:00\n\n";
 
 print "TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes\n";
-putenv("TZ=America/Santo_Domingo");
+date_default_timezone_set('America/Santo_Domingo');
 $tStamp = mktime (17, 17, 17, 1, 291, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -65,7 +65,7 @@ print "wanted=Sunday            00:30:00\n\n";
 
 print "TZ=Pacific/Truk - Is it OK for this to be 10 AM?  Note: does not
 appear to have a DST or timezone transition.\n";
-putenv("TZ=Pacific/Truk");
+date_default_timezone_set('Pacific/Truk');
 $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);
@@ -74,7 +74,7 @@ print "wanted=Tuesday            00:00:00\n\n";
 
 print "TZ=Pacific/Ponape - Is it OK for this to be 11 AM?  Note: does
 not appear to have a DST or timezone transition.\n";
-putenv("TZ=Pacific/Ponape");
+date_default_timezone_set('Pacific/Ponape');
 $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);
@@ -82,7 +82,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Monday            00:00:00\n\n";
 
 print "TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes\n";
-putenv("TZ=America/Scoresbysund");
+date_default_timezone_set('America/Scoresbysund');
 $tStamp = mktime (17, 17, 17, 1, 4099, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -90,7 +90,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Sunday            02:00:00\n\n";
 
 print "TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes\n";
-putenv("TZ=America/Guyana");
+date_default_timezone_set('America/Guyana');
 $tStamp = mktime (17, 17, 17, 1, 2031, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -98,7 +98,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Thursday            00:45:00\n\n";
 
 print "TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes\n";
-putenv("TZ=Asia/Tehran");
+date_default_timezone_set('Asia/Tehran');
 $tStamp = mktime (17, 17, 17, 1, 2855, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
@@ -107,7 +107,7 @@ print "wanted=Tuesday            00:30:00\n\n";
 
 print "TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
 not appear to have a DST or timezone transition.\n";     
-putenv("TZ=Pacific/Tarawa");
+date_default_timezone_set('Pacific/Tarawa');
 $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);
@@ -115,7 +115,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Monday            00:00:00\n\n";
 
 print "TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes\n";
-putenv("TZ=Africa/Monrovia");
+date_default_timezone_set('Africa/Monrovia');
 $tStamp = mktime (17, 17, 17, 1, 845, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Monday", $tStamp);
@@ -123,7 +123,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Monday            00:44:30\n\n";
 
 print "TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes\n";
-putenv("TZ=Asia/Katmandu");
+date_default_timezone_set('Asia/Katmandu');
 $tStamp = mktime (17, 17, 17, 1, 5838, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
@@ -131,7 +131,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Wednesday            00:15:00\n\n";         
 
 print "TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes\n";
-putenv("TZ=Pacific/Nauru");
+date_default_timezone_set('Pacific/Nauru');
 $tStamp = mktime (17, 17, 17, 1, 3401, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
@@ -139,7 +139,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Tuesday            00:30:00\n\n";
 
 print "TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes\n";
-putenv("TZ=Pacific/Niue");
+date_default_timezone_set('Pacific/Niue');
 $tStamp = mktime (17, 17, 17, 1, 3189, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -148,7 +148,7 @@ print "wanted=Sunday            00:30:00\n\n";
 
 print "TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
 or timezone transition.\n";
-putenv("TZ=Pacific/Port_Moresby");
+date_default_timezone_set('Pacific/Port_Moresby');
 $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 Thursday", $tStamp); 
@@ -156,7 +156,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Thursday            00:00:00\n\n";          
 
 print "TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes\n";
-putenv("TZ=America/Miquelon");
+date_default_timezone_set('America/Miquelon');
 $tStamp = mktime (17, 17, 17, 1, 3767, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -165,7 +165,7 @@ print "wanted=Thursday            01:00:00\n\n";
 
 print "TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
 timezone transition.\n";
-putenv("TZ=Pacific/Palau");   
+date_default_timezone_set('Pacific/Palau');   
 $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);
@@ -174,7 +174,7 @@ print "wanted=Saturday            00:00:00\n\n";
 
 print "TZ=Pacific/Funafuti - Is it OK for this to be midday?  Note: does
 not appear to have a DST or timezone transition.\n";
-putenv("TZ=Pacific/Funafuti");
+date_default_timezone_set('Pacific/Funafuti');
 $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);
@@ -183,7 +183,7 @@ print "wanted=Wednesday            00:00:00\n\n";
 
 print "TZ=Pacific/Wake - Is it OK for this to be midday?  Note: does not
 appear to have a DST or timezone transition.\n";
-putenv("TZ=Pacific/Wake");
+date_default_timezone_set('Pacific/Wake');
 $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);
@@ -192,7 +192,7 @@ print "wanted=Tuesday            00:00:00\n\n";
 
 print "TZ=Pacific/Wallis - Is it OK for this to be midday?  Note: does
 not appear to have a DST or timezone transition.\n";
-putenv("TZ=Pacific/Wallis");
+date_default_timezone_set('Pacific/Wallis');
 $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);
@@ -200,7 +200,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Tuesday            00:00:00\n\n";
 
 print "TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes\n";
-putenv("TZ=America/Paramaribo");
+date_default_timezone_set('America/Paramaribo');
 $tStamp = mktime (17, 17, 17, 1, 5381, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Monday", $tStamp);
index 2a8da034120c9fff72ba65ac3d74f18f438001aa..dc8a52d094f7b71cfed6b50b7134d3282ebc4227 100644 (file)
@@ -5,7 +5,7 @@ error_reporting=2047
 date.timezone=UTC
 --FILE--
 <?php
-putenv("TZ=");
+date_default_timezone_set('UTC');
 setlocale(LC_ALL, 'C');
 
 print "TZ has NOT been set\n";
@@ -17,7 +17,7 @@ print "strftime " . strftime("%r %B%e %Y %Z %z", $tStamp) . "\n";
 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);
index 4259b49a1c4fce42fe963f30fb76186a450d0961..f6cb7d975e12fa60044ae9e1e417d99e04ce2ea7 100644 (file)
@@ -2,7 +2,7 @@
 Bug #35425 (idate() function ignores timezone settings)
 --FILE--
 <?php
-putenv('TZ=America/Montreal');
+date_default_timezone_set('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) {
index aa259b577cab70ff04d7cffaf421f00a4ab7ad22..00b85a60cc5b3d8d0e8062de3ae6e7d293a44deb 100644 (file)
@@ -11,7 +11,7 @@ $timezones = array(
 
 foreach($timezones as $timezone)
 {
-    putenv('TZ='.$timezone);
+    date_default_timezone_set($timezone);
 
     /* status of daylight saving time unknown */
     var_dump(mktime(0, 0, 0, 1, 1, 2002));
index 147b10a8236c86c68b48e96796976d02ffbb3d74..07c1a2851f9356f88b064f4075c72e5aa4554fd0 100644 (file)
@@ -4,7 +4,7 @@ timezone configuration [1]
 date.timezone=GMT
 --FILE--
 <?php
-       putenv('TZ=Europe/Oslo');
+       date_default_timezone_set('Europe/Oslo');
        echo strtotime("2005-06-18 22:15:44"), "\n";
 
        putenv('TZ=Europe/London');
index 111e826f715c240f1d552f8c0e8915de19b507d6..af4582b738837f8a6f99cf4283683be5f36c0c03 100644 (file)
@@ -14,6 +14,6 @@ $var = ini_get('error_reporting');
 var_dump($var);
 ?>
 --EXPECT--
-string(1) "1"
-string(1) "0"
+unicode(1) "1"
+unicode(1) "0"