结果:2010-06-04 02:02:32怎么时间不对?

解决方案 »

  1.   

    if (PHP_VERSION >= '5.1')
    {
        date_default_timezone_set("Asia/Shanghai");
    }
    echo "当前时间:".date("Y-m-d H:i:s",time());
      

  2.   

    没有设置时区
    打印出来的是GMT时间
    中国的时区是GMT+8
      

  3.   

    你要設置你的php.ini的时区...
    开始默认是格林尼治时间...
    你要设置成PRC就是中国时间.
    data.timezone=PRC
      

  4.   


    跟你操作系统的时区设置没有任何关系,要在PHP里设置,二楼已经给出代码了,或者改php.ini也行。
      

  5.   


    ------------------------------------
    ;;;;;;;;;;;;;;;;;;;
    ; Module Settings ;
    ;;;;;;;;;;;;;;;;;;;[Date]
    ; Defines the default timezone used by the date functions
    date.timezone = Asia/Shanghai [Syslog]
    ; Whether or not to define the various syslog variables (e.g. $LOG_PID,
    ; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
    ; runtime, you can define these variables by calling define_syslog_variables().
    define_syslog_variables  = Off----------------重启了服务,好像还不行...
      

  6.   

    相关设置是修改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 = PRC其中PRC是“中华人民共和国”! 
      

  7.   


    date_default_timezone_set('PRC');
      

  8.   

    只是要你明白,解决问题可以有很多种方法...
    当然最方便的还是程序设置...
    不用理会php.ini的配置...
      

  9.   


    date("Y-m-d H:i:s",time()+8*3600)
      

  10.   

    $addtime=data("Y-M-D h:i:s");这个函数运行 Fatal error: Call to undefined function data() 错误怎么解决 ?