0

my centos server has a wrong utc time (example: now it's 7.54 utc and my server shows 8.15 utc). I'll fix this, but which will be the effects on WordPress? There'll be problems with cookies/cache or such things?

2

WordPress essentially completely ignores native PHP date functionality, in favor of its own handling. That traditionally allowed it to manage related aspects (such as timezones and translation) with no regards for server configuration.

My educated guess that it would be largely oblivious to such change. At most the cron tasks might fire in bulk and some forms might fail due to nonces (which are valid for many hours, so probability of less than an hour shift affecting them is low).

  • Basically, after the 21mins of caught up time, everything will work fine, right? – testermaster Apr 15 '15 at 20:06
  • Yes, that would be my educated guess. As always you can just pull site into testing environment and experiment with time shift in a safe way. – Rarst Apr 15 '15 at 20:20
1

If you haven't already done so, install the ntp package on your web server(s), it automatically syncs the time for you against multiple reference time servers (atomic clocks). Otherwise server clocks do tend to drift over time.

Crucially, ntp also makes any adjustments gradually (in steps), so as to minimise the chance of confusing any automated processes on the server:

ntpd's reaction will depend on the offset between the local clock and the reference time. For a tiny offset ntpd will adjust the local clock as usual; for small and larger offsets, ntpd will reject the reference time for a while. In the latter case the operation system's clock will continue with the last corrections effective while the new reference time is being rejected. After some time, small offsets (significantly less than a second) will be slewed (adjusted slowly), while larger offsets will cause the clock to be stepped (set anew). Huge offsets are rejected, and ntpd will terminate itself, believing something very strange must have happened.

Source: http://www.ntp.org/ntpfaq/NTP-s-algo.htm

Use ntpq -p to show the current status.

As per @Rarst's answer, in WordPress, the cron jobs will just fire in bulk.

If you schedule your posts for publication at a specific date/time, double check none are showing as "missed", but you wouldn't expect that with your example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.