dongyu4908 2014-08-26 02:38
浏览 10

PHP时间为1小时[重复]

This question already has an answer here:

I've already set the timezone setting in php.ini but its 1 hour ahead of the timezone I have set.

I thought this would be covered already in here, but the only solution I can find is telling me to check the timezone, which I have and it's correct.

I have "America/Toronto" set. I live in Toronto and it's not the right time.

The solution to the question marked as duplicate did not work for me.

Is there something about day light savings I need to check?

</div>
  • 写回答

2条回答 默认 最新

  • dqdt45183 2014-08-26 02:46
    关注

    Just use date_default_timezone_set("Europe/Ljubljana"); in your PHP file that is included in other files (like config or something similar).

    To change your timezone in php.ini properly then use date.timezone = "Europe/Ljubljana" on top of the file.

    Also check list of supported PHP timezones.

    评论

报告相同问题?