fixed time comparison
Merged date comparison fix from master