Recently, while working on the next version of the Post Expiration Date WP plugin, I’ve spent a lot of time exploring WordPress’ handling of dates and time. This has been an interesting, often frustrating time but I’ve learned a lot and found a number of great resources on the subject. Here are some of the top ones.
The big caveat here is that many WordPress resources are outdated. As PHP and WordPress versions change, good advice doesn’t always age well, yet the posts giving that advice still ranks highly and reads as sound. These are all fundamentally good articles that seem to be relevant WordPress development in 2019. I’ve pulled out some lines if there is stuff that is not obvious to new WP developers but also worth knowing.
strtotime()
is going to interpret that timezone-agnostic date as the time in the current timezone!”Fundamentals:
I’m at the very start of my datetime exploration so I’ll update this post periodically. Please email me if you have any tips or suggestions!
Sal January 21st, 2019
Posted In: Web Development