Refactoring of the parsing of date and time.