爲什麼我的php時間比我的電腦慢4個小時?我怎樣才能解決這個問題?關於php代碼和重新調整時間
<?php
echo"<H2>it's my test program.</H2>I'll make it my own...<br>";
$string="Tell me the time.";
echo"$string <br>";
$string1="It's";
$t=date("H.i");
if($t<"18" and $t>"1"){
echo"$string1 evening and its $t.";
}
else{
echo"$string1 $t";
}
?>
並將其顯示mozila:
這是我的測試程序。我會讓它成爲我自己的...告訴我時間。這是 20.36。但我的筆記本電腦的時間是上午2點36分
在您的php文件中設置正確的時區:http://php.net/manual/en/function.date-default-timezone-set.php – jeroen 2014-09-29 20:44:47
時區,可能。特別是如果你通過網絡服務器在除筆記本電腦以外的某臺機器上運行此程序。 – 2014-09-29 20:45:01
http://stackoverflow.com/questions/13229564/how-to-change-the-php-server-time-zone – swordsecurity 2014-09-29 20:45:06