1--TEST-- 2date_default_timezone_set() function [1] 3--SKIPIF-- 4<?php 5if (substr(PHP_OS, 0, 3) == 'WIN') die('skip diff TZ detection on windows.'); 6?> 7--INI-- 8date.timezone= 9--FILE-- 10<?php 11 putenv("TZ="); 12 $date1 = strtotime("2005-01-12 08:00:00"); 13 $date2 = strtotime("2005-07-12 08:00:00"); 14 date_default_timezone_set("America/Indiana/Knox"); 15 $date3 = strtotime("2005-01-12 08:00:00"); 16 $date4 = strtotime("2005-07-12 08:00:00"); 17 18 echo date_default_timezone_get(), "\n"; 19 echo date(DATE_ISO8601, $date1), "\n"; 20 echo date(DATE_ISO8601, $date2), "\n"; 21 echo date(DATE_ISO8601, $date3), "\n"; 22 echo date(DATE_ISO8601, $date4), "\n"; 23?> 24--EXPECTF-- 25Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3 26 27Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 4 28America/Indiana/Knox 292005-01-12T03:00:00-0500 302005-07-12T03:00:00-0500 312005-01-12T08:00:00-0500 322005-07-12T08:00:00-0500 33