From: Katsumi Yamaoka Date: Fri, 3 Dec 2021 16:28:48 +0000 (+0100) Subject: Fix regression introduced by the previous date-to-time change X-Git-Tag: emacs-29.0.90~3619^2~26 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=32a8b3bc22bfc0aeca9943699e7a43b68915122b;p=emacs.git Fix regression introduced by the previous date-to-time change * 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). --- diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 6407138953c..8a6ee0f2702 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -158,7 +158,10 @@ If DATE lacks timezone information, GMT is assumed." (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)