fix up the datetime comparison error caused by timezone.

"can't compare offset-naive and offset-aware datetimes".
Merge pull request #1525 from tonyseek/fixup-timezone-comparison

Fix a datetime comparison error related to time zones