Datetime aware patch

Solves the "can't compare offset-naive and offset-aware datetimes" problem.