Let's say I have a date, June 16, 2011 at 7:00. I want to be able to check, say, on August 5, 2011 at 7:00, and be able to say that it is exactly a multiple of 1 day from the first date, while 7:01 will not be considered, since this is not an exact few.
Another test suite: let's say we have June 16, 2011 at 7:00, and I want to check whether a particular minute with an interval of exactly 2 hours since then. Thus, 9:00, 11:00, 13:00, etc. They will be considered, but 9:30 and 10:00 will not. And this can continue for several days and months - on September 1 at 7:00 it will still be considered every 2 hours. (And no, at the moment I don’t know how I will handle DST: D)
I thought about it for a moment and couldn’t think about what already exists in PHP or MySQL to make it easy, but hell it could, so I wanted to give it up and ask before I started reinventing the wheel.
This is on PHP 5.1, unfortunately.
source
share