PHP date() and time() ahead of server by about 3 minutes

A couple days ago something changed and now PHP is returning a value in the future by about 3 minutes using the date() or time() functions, example output:

PHP script output

  • php date("Ymd H:i:s"):2016-10-27 14:33:42

  • time(): 1477604022

  • Server date output done a few seconds later

  • Thu Oct 27 14:30:06 PDT 2016
  • Any idea why it would be offset by a couple minutes?


    Figured it out, for some reason NTP (network time tool) stopped. We restarted NTP and the problem was fixed.

    链接地址: http://www.djcxy.com/p/10120.html

    上一篇: 获取日期之间的差异返回零

    下一篇: PHP date()和time()提前3分钟