Working with dates in PHP is one of those things that you either have a good handle on, you’re working on understanding, or you’re stuck in the rabbit hole of the documentation that’s in the manual.

If you’re working with WordPress, though, the chance that you’re going to need to work with dates is quite high. Nearly everything that we publish has at least one date associated with it.
This includes post, pages, custom post types, revisions, drafts, and so on.
Furthermore, there’s a chance that custom work that you need to develop with require that you find the difference in two dates using PHP. And though there are multiple ways of doing this, there’s a process that I’ve been following for something.





