fix the bug of the date time comparison