时间函数问题-设置PHP5的时区
<?php
$currtime=time();
$currtimestr=strftime ("%H:%M:%S ",$currtime);
echo "The time is : ".$currtimestr;
print (strftime("%A"));
?>
在PHP5中,不能和PHP4一样使用date() , time() 等时间函数正确地取得本地时间, 不同的代码在不同的OS里会产生不同的结果。解决办法,为PHP5设置统一的时区:
编辑 “php.ini”,找到以下行修改:
date.timezone = PRC //PRC代表中华人民共和国
Your opinion counts (您的意见很重要)