dongpaipu8394 2010-10-26 22:27
浏览 12

没有得到正确的日期/时间

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?

  • 写回答

1条回答 默认 最新

  • doucepei5298 2010-10-26 22:30
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程