在php中调用时间函数
echo date("Y/m/d");
?>
有警告(依赖系统的时区设置不安全)
Warning: date() [function.date]: 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 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/apache2/htdocs/php/date.php on line 3
2009/09/21
解决方法(设置一个时区即可)
date_default_timezone_set('UTC');
echo date("Y/m/d");
?>
阅读(1307) | 评论(0) | 转发(0) |