diff options
| author | Richard M. Stallman | 1993-07-07 17:55:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-07-07 17:55:55 +0000 |
| commit | e6a4a267ff8b2d413820bb539dc144ec786967ed (patch) | |
| tree | ffcc98b30fdc64bd104839ed4dd7b28ae5e6df3b | |
| parent | f3098917470a2d15e9c243bf58ea2b22666e45b4 (diff) | |
| download | emacs-e6a4a267ff8b2d413820bb539dc144ec786967ed.tar.gz emacs-e6a4a267ff8b2d413820bb539dc144ec786967ed.zip | |
(mail-rfc822-time-zone, mail-rfc822-date): New fns.
| -rw-r--r-- | lisp/mail/mail-utils.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index 0d32fbe23fe..5f45ab00acd 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el | |||
| @@ -211,6 +211,21 @@ If third arg ALL is non-nil, concatenate all such fields with commas between." | |||
| 211 | "\\|" | 211 | "\\|" |
| 212 | (substring labels (match-end 0)))))) | 212 | (substring labels (match-end 0)))))) |
| 213 | labels) | 213 | labels) |
| 214 | |||
| 215 | (defun mail-rfc822-time-zone (time) | ||
| 216 | (let* ((sec (or (car (current-time-zone time)) 0)) | ||
| 217 | (absmin (/ (abs sec) 60))) | ||
| 218 | (format "%c%02d%02d" (if (< sec 0) ?- ?+) (/ absmin 60) (% absmin 60)))) | ||
| 219 | |||
| 220 | (defun mail-rfc822-date () | ||
| 221 | (let* ((time (current-time)) | ||
| 222 | (s (current-time-string time))) | ||
| 223 | (string-match "[^ ]+ +\\([^ ]+\\) +\\([^ ]+\\) \\([^ ]+\\) \\([^ ]+\\)" s) | ||
| 224 | (concat (substring s (match-beginning 2) (match-end 2)) " " | ||
| 225 | (substring s (match-beginning 1) (match-end 1)) " " | ||
| 226 | (substring s (match-beginning 4) (match-end 4)) " " | ||
| 227 | (substring s (match-beginning 3) (match-end 3)) " " | ||
| 228 | (mail-rfc822-time-zone time)))) | ||
| 214 | 229 | ||
| 215 | (provide 'mail-utils) | 230 | (provide 'mail-utils) |
| 216 | 231 | ||