<?
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本回答被提问者采纳
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配置有问题
php.ini配置有问题
第3个回答 2010-03-19
echo date('YMD');