PHP wrong date/time

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

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

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

7条回答
  •  长情又很酷
    2021-02-19 14:06

    PHP time is based on epoch time scale which uses GMT and later UTC. Most people now refer to it as unix time. Because PHP uses unix time, timezones are not used. I believe subtracting the timezone hours in seconds is the correct method to adjust for the differences.

提交回复
热议问题