根据网上的说明,将php.ini的date.timezone值设为PRC,但在页面中调用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.php.ini中的设置应该没有问题,拼写什么的也都正确

解决方案 »

  1.   

    重启过,Asia/Shanghai也试过,都没有效果但是在页面前加上date_default_timezone_set("PRC") 后可以正常显示。
      

  2.   

    In order of preference, this function returns the default timezone by: Reading the timezone set using the date_default_timezone_set() function (if any) Reading the TZ environment variable (if non empty) Reading the value of the date.timezone ini option (if set) Querying the host operating system (if supported and allowed by the OS) 
      

  3.   

    Reading the value of the date.timezone ini option (if set) 
    我设置了为什么还不行?
      

  4.   

    上面说的这是读取顺序,TZ的优先级在ini之前,你要检查TZ的设置
      

  5.   

    Unix / Liunx下用date命令查看
    Windows下在控制面板中
      

  6.   

    说错了,这个是第4个系统system的timezone查看方法第二个TZ应该是phpinfo()列出的date部分的Default timezone
      

  7.   

    用phpinfo()查看了一下系统信息果然Default timezone 设置为了UTC我还想请教一下  Default timezone 可不可以在哪里设置?
      

  8.   

    就在date函数中,第一个参数可以设timezone的
    date("O +0800", time());
      

  9.   

    我是直接写在全局common.php文件里面的啊
    “date_default_timezone_set('PRC');”
      

  10.   

    谢谢各位的解答,特别是CunningBoy,问题已解决。
      

  11.   

    注意一下apache设置里面默认的php.ini文件的路径
    我的是因为路径不对根本没有读取php.ini文件。