1311 datetime comparision

Fixing #1311