changeset 4022:a3d3d7eef5ce

(mail-rfc822-time-zone, mail-rfc822-date): New fns.
author Richard M. Stallman <rms@gnu.org>
date Wed, 07 Jul 1993 17:55:55 +0000
parents 5a8ed60f39f2
children 5e4f918d5d44
files lisp/mail/mail-utils.el
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/mail-utils.el	Wed Jul 07 17:55:28 1993 +0000
+++ b/lisp/mail/mail-utils.el	Wed Jul 07 17:55:55 1993 +0000
@@ -211,6 +211,21 @@
 		    "\\|"
 		    (substring labels (match-end 0))))))
   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))))
+
+(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))))
 
 (provide 'mail-utils)