Saving time with PHP and date math
18 Jan
You may have cringed when reading the term “date math,” which sounds both cumbersome and difficult. It brings to mind the addition and subtraction of tricky numbers like 7, 29, and 31; and concepts like “two weeks from now,” “yesterday,” and “next month.” And if you’ve every tried to build a system that tracks relative dates you know such things can be a hassle.
So why bother? Because date math is very useful! For example, suppose you manage a website that includes due dates, submission deadlines, and priority registration periods that recur. If you’re me, you manage a site that’s full of such dates that recur every academic quarter. Keeping these dates in sync is a task that PHP’s date math functions were born written to do.




Who’s saying what