);
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) {
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
--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') {
?>
--FILE--
<?php
-putenv("TZ=US/Eastern");
+
if (date('T') == 'GMT') {
putenv("TZ=EST5EDT4,M4.1.0,M10.5.0");
}
--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";
?>
--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";
--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";
);
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);
--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--
--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
--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";
--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"));
--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"));
?>
--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--
--TEST--
Bug #27719 (mktime returns incorrect timestamp for dst days)
--INI--
+date.timezone=EST
error_reporting=2047
--FILE--
<?php /* $Id$ */
- putenv("TZ=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);
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);
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);
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);
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);
);
foreach ($timezones as $timezone) {
- putenv("TZ=$timezone");
+ date_default_timezone_set($timezone);
echo $timezone, "\n";
foreach ($timestrings as $timestring) {
--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"));
?>
--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--
--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";
--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";
--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";
--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";
--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";
--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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
--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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
date.timezone=UTC
--FILE--
<?php
-putenv("TZ=");
+
setlocale(LC_ALL, 'C');
print "TZ has NOT been set\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);
--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) {
--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");