DEV Community

Alex Antsiferov
Alex Antsiferov

Posted on

On comparing time intervals

Here's an edge case to keep in mind when querying the database for something that has duration (for example, events) using a from..to date/time filter: long events can start before from and end after to.
So if we check only that the start or end time of the event fall within the interval, we can miss an event, even though it overlaps ("covers") the required interval.

Top comments (0)