From: Paul Eggert Date: Sat, 4 Dec 2021 10:58:37 -0800 Unfortunately the latest change to time-date.el reintroduced Bug#52209. I installed the attached patch to fix this . . . I'm sure none of you will be surprised to learn that parse-time-string still doesn't recognize single-digit months or days, with the same fallback-to-the-epoch behavior that threw me for a loop originally. (format-time-string "%F %T %z" (date-to-time "2022-1-12")) => "1999-12-31 19:00:00 -0500" And adding a time makes it work again because it seems that timezone-make-date-arpa-standard does accept single-digit months and days. Go figure. The attached patch extends parse-time-string by using regexps instead of string manipulation of fixed-width fields. This could possibly break interface compatibility, especially if you expect anyone to customize parse-time-rules. So I will not be surprised if you decline to adopt it. > (These functions were never really intended to support parsing dates > like that -- only strict RFC822 date strings were originally supported, > but it's become more DWIM as time has passed. Yes, date-to-time has definitely ... evolved. My understanding is that date-to-time's RFC822 parsing is present only for backward compatibility, and that we shouldn't attempt to enhance it (here, the enhancement would be pointless as the RFC822 parsing fills in the blanks anyway). So the patch I just installed adds the new feature only for the normal path taken, when not doing the RFC822 hack. PS. Internet RFC 822 has been obsolete since 2001, and the Emacs code should be talking about RFC 5322 everywhere except when Emacs is explicitly supporting the obsolete standard instead of the current standard. And we should rename functions like rfc822-goto-eoh to rfc-email-goto-eoh, to help avoid confusion or further function renaming. But I digress.... Since Emacs time functions have evolved well beyond email, I would argue that even "rfc-email-" is too specific a prefix for them. So if this patch is not suitable, maybe it's (cough, cough) time for a new time and date parsing API that supports a broader range of human-generated dates and times, with better error handling and I18N support. WDYT? -- Bob Rogers http://www.rgrjr.com/