开发者

Do not get correct date/time

开发者 https://www.devze.com 2023-01-21 22:28 出处:网络
I have a PHP开发者_高级运维 page in a server, located in the US. The code in the page is echo date(\'Y-m-d H:i:s\');

I have a PHP开发者_高级运维 page in a server, located in the US.

The code in the page is

echo date('Y-m-d H:i:s');

When I take this page, it gives a time, for example, 2010-10-26 10:20:07.

But when I refresh the page on the very next second, it gives the same date with a different time (a huge difference).

For example, 2010-10-26 08:25:58

What is the reason for that?


If you are on shared hosting someone might be changing the server locale or server timezone. Actually, two people might be changing it which causes it to jump back and forth each page refresh as one scripts sets it to one thing while another sets it to another thing.

0

精彩评论

暂无评论...
验证码 换一张
取 消