improve time parsing and comparing