were the posting times set on the old server (then migrated) or on the new one? I’m thinking that the time settings on the old server may have been incorrect.
Nope. These are brand new posts, created on the new server. It’s a real headscratcher.
When I compare the values in my two different servers, I notice that the site with the problem is recording GMT INCORRECTLY in the database:
For instance on the server with the problem:
post_date: 2016-08-04 00:01:00, post_date_gmt: 2016-08-04 01:01:00
And the server without the problem:
post_date: 2016-08-04 00:01:00, post_date_gmt: 2016-08-04 05:01:00
PHP seems to know the proper difference between GMT and CDT, but whatever is recording the post_date_gmt to the database doesn’t seem to.
I’m currently thinking it’s something in the get_gmt_from_date logic in /wp-includes/formatting.php, but that’s above my paygrade.
SOLVED!
Turns out that WordPress interchangeably uses UTC and GMT in its code, and my server wasn’t returning UTC properly, due to a corruption of the timezone file for UTC under /usr/share/zoneinfo. I simply copied the GMT file to the UTC file, and the problem is solved.
Anyone on MediaTemple with this problem should check /usr/share/zoneinfo, and if the UTC and GMT files aren’t the same, you have the same issue.
That is some very impressive sleuthing.
uploading a beer for you!
Haha. I could use one after all of that. Who knew that GMT and UTC could be different.
Easiest way to test if a server has the problem. In the shell run these two commands back to back:
TZ="UTC" date
TZ="GMT" date
If they’re different – bad juju.