简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM