首页 » 默认不分类 » php5时区问题导致相差8小时

php5时区问题导致相差8小时

php5.1开始加入了格林威治时间GMT,所以中国区的要差8小时,可以修改下配置。
[Date]
; Defines the default timezone used by the date functions
date.timezone = PRC

如果没有修改php.ini的权限,只需要在调用时间日期函数的时候,调用 date_default_timezone_set('PRC')即可!
也可以调用date_default_timezone_get()来查看当前的时区设置!

,

转发到新浪微博 转发到新浪微博

目前这篇文章有2条评论(Rss)

  1. oyun oyna | #1
    05/16/2012 at 13:10

    I used to be curious about your subsequent publish admin genuinely wanted this blog super wonderful blog

  2. sempak | #2
    05/16/2012 at 23:19

    301 Moved Permanently I was suggested this web site by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my problem. You are amazing! Thanks! your article about 301 Moved PermanentlyBest Regards Rolf

我要评论