diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-12-05 22:43:55 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-12-05 23:24:09 -0800 |
commit | 15f20c0bd06a25bbb4ea90e501ef85290509c43b (patch) | |
tree | e1adafdd3420ecd38459628115baf1f05affb906 /lisp/mail/mail-utils.el | |
parent | 186637314dfa287b4b8178b668de92ecb57fdf1a (diff) | |
download | emacs-15f20c0bd06a25bbb4ea90e501ef85290509c43b.tar.gz emacs-15f20c0bd06a25bbb4ea90e501ef85290509c43b.tar.bz2 emacs-15f20c0bd06a25bbb4ea90e501ef85290509c43b.zip |
Simplify RFC 5322 time zone generation
* lisp/mail/feedmail.el (feedmail-rfc822-time-zone)
(feedmail-rfc822-date, feedmail-default-message-id-generator):
* lisp/mail/mail-utils.el (mail-rfc822-time-zone, mail-rfc822-date):
* lisp/timezone.el (timezone-make-arpa-date):
Simplify by using format-time-string with %z.
* lisp/mail/feedmail.el (feedmail-rfc822-time-zone):
* lisp/mail/mail-utils.el (mail-rfc822-time-zone):
Mark these should-have-been-internal functions obsolete.
Diffstat (limited to 'lisp/mail/mail-utils.el')
-rw-r--r-- | lisp/mail/mail-utils.el | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index 3eb3ccb93de..f1b0590bec7 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el @@ -368,19 +368,12 @@ matches may be returned from the message body." labels) (defun mail-rfc822-time-zone (time) - (let* ((sec (or (car (current-time-zone time)) 0)) - (absmin (/ (abs sec) 60))) - (format "%c%02d%02d" (if (< sec 0) ?- ?+) (/ absmin 60) (% absmin 60)))) + (declare (obsolete format-time-string "29.1")) + (format-time-string "%z" time)) (defun mail-rfc822-date () - (let* ((time (current-time)) - (s (current-time-string time))) - (string-match "[^ ]+ +\\([^ ]+\\) +\\([^ ]+\\) \\([^ ]+\\) \\([^ ]+\\)" s) - (concat (substring s (match-beginning 2) (match-end 2)) " " - (substring s (match-beginning 1) (match-end 1)) " " - (substring s (match-beginning 4) (match-end 4)) " " - (substring s (match-beginning 3) (match-end 3)) " " - (mail-rfc822-time-zone time)))) + (let ((system-time-locale "C")) + (format-time-string "%-d %b %Y %T %z"))) (defun mail-mbox-from () "Return an mbox \"From \" line for the current message. |