How to see if one date is before the other or if they are set in the same time?