PHP显示服务器的当前日期/时间

Ben*_*nes -5 php apache freebsd

当我使用这个脚本时:

    <?php
print strftime('%c');
?> 
Run Code Online (Sandbox Code Playgroud)

我明白了

Warning: strftime(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/apache22/data/virtual/midterm/boballo.php on line 3
Sun Jul 6 20:41:17 2014
Run Code Online (Sandbox Code Playgroud)

我想要显示的是服务器的当前日期/时间并将其打印到PHP脚本.我以为服务器(freebsd)会设置时区.如何显示服务器的当前日期并使用php脚本打印?

Fle*_*der 5

那么,请阅读错误消息告诉您的内容,最重要的部分:

需要使用date.timezone设置或date_default_timezone_set()功能.

做吧!