* lisp/calendar/time-date.el (date-to-time): The function needs to
test if `parse-time-string' returns a valid data as the old
version did it with the help of `encode-time' (bug#52209).
(encode-time
(decoded-time-set-defaults
(condition-case err
- (parse-time-string date)
+ (let ((time (parse-time-string date)))
+ (prog1 time
+ ;; Cause an error if data `parse-time-string' returns is invalid.
+ (setq time (encode-time time))))
(error
(let ((overflow-error '(error "Specified time is not representable")))
(if (or (equal err overflow-error)