dqouryz3595 2018-09-18 17:25
浏览 46

根据时区,当前时间无效

Using below code in php to get current time:

date_default_timezone_set("America/Toronto");
echo date('y-m-d H:i:s', time());

But, there is a time difference of 3 minutes and 30 seconds with real time.

  • 写回答

1条回答 默认 最新

  • drfkl66684 2018-09-18 19:29
    关注

    3 minutes and 30 seconds is not enough to be a timezone issue. No active timezone is shifted only by 210 seconds.

    The issue is probably caused by either your server or your local machine being out of sync. Have you checked that your local machine actually matches the current time? Check for example third-party services such as Google to determine if it is your server or local machine that is out of sync.

    If it is your local machine, the solution depends on your system. If it is your server, it can be updated with timedatectl --adjust-system-clock.

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!