php中date()函数无法正常运行

<?
echo (YMD);
?>
在浏览器上运行结果为:
Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 '8.0/no DST' instead in E:\AppServ\www\PHPDocument2.php on line 2
2010MarFri
我电脑是XP系统,IE6
echo ('YMD')和echo ('Y-M-D')都不行的,还是老样子.....

第1个回答  推荐于2016-01-30
<?php
echo date('Y-m-d');

?>
解决方法就是修改php安装目录下的php.ini文件里的date.timezone
修改

[Date]
; Defines the default timezone used by the date functions
;
; date.timezone =



[Date]
; Defines the default timezone used by the date functions
;
date.timezone = Asia/Shanghai本回答被提问者采纳
第2个回答  2010-03-22
你要输出结果已经运行出来了;
php.ini配置有问题
第3个回答  2010-03-19
echo date('YMD');

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网