When working with dates, time and calendars it becomes a pretty common requirement to compare dates-Testing whether a date occurs after or before one date, whether an event occurs between two specific times, etc. The easiest way to work with dates in PHP is with the DateTime object.
Obviously for us (as humans) it is pretty easy to see that my party is not during my shift. On the other hand for the computer to see this is a whole other issue.