PHP wrong date/time

后端 未结 7 1301
南笙
南笙 2021-02-19 13:28

PHP date() & time() return incorrect time:

When date.timezone = \"Europe/Riga\" the time returned by date() was <

7条回答
  •  猫巷女王i
    2021-02-19 14:07

    Reading PHP manual seems that behaviour of date.timezone is affected by settings in php.ini. There is another way to set the default timezone in all date/time function and it's the date_default_timezone_set. Try to set it with:

    date_default_timezone_set('Europe/Riga');
    

    instead of your date.timezone code.

提交回复
热议问题