duandong1963 2011-06-30 23:30
浏览 7
已采纳

运行代码点火器,几个站点,一个服务器,不同的时区?

I am using code igniter to power our site, but are not using the code igniter date library (just the default php Date),

We have several, sites on the same server,

they reside in

www-nz
www-au
www-us

because all these sites use the same php.ini I cannot use date.timezone.

So I was thinking, sweet as, Ill just use .htaccess SetEnv TZ location e.g Pacific/Auckland

But it is having no effect, I have a feeling that code igniter might be resetting the timezone somewhere...

Anyone have a solution?

  • 写回答

2条回答 默认 最新

  • douwen3836 2011-06-30 23:58
    关注

    date_default_timezone_set() is what I place the top of my index.php files in CodeIgniter. However I've learned that setting everything to UTC and then making any time zone conversions on the client side will save you A LOT of headaches :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?