]> granicus.if.org Git - neomutt/commitdiff
Byrial's %D time format patch.
authorThomas Roessler <roessler@does-not-exist.org>
Sun, 10 Jan 1999 09:11:33 +0000 (09:11 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Sun, 10 Jan 1999 09:11:33 +0000 (09:11 +0000)
doc/manual.sgml.in
hdrline.c

index 9ec52496c86b9bed2f79ae780291265529adcb32..857c616ca52de04e84d0a93ab68af69dbaf5151b 100644 (file)
@@ -3017,6 +3017,8 @@ following sequences are defined in Mutt:
 %C      current message number
 %d      date and time of the message in the format specified by
         ``date_format'' converted to sender's time zone
+%D      date and time of the message in the format specified by
+        ``date_format'' converted to the local time zone
 %f      entire From: line (address + real name)
 %F      author name, or recipient name if the message is from you
 %i      message-id of the current message
index 89c5ad543d1b40feaf311a4a727814926cabeec1..85600e07d8f090df9cf7d6dab967fc10b5a2710f 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -191,7 +191,8 @@ int mutt_user_is_recipient (HEADER *h)
  * %B = the list to which the letter was sent
  * %c = size of message in bytes
  * %C = current message number
- * %d = date and time of message (using strftime)
+ * %d = date and time of message using $date_format and sender's timezone
+ * %D = date and time of message using $date_format and local timezone
  * %f = entire from line
  * %F = like %n, unless from self
  * %i = message-id
@@ -294,6 +295,7 @@ hdr_format_str (char *dest,
       break;
 
     case 'd':
+    case 'D':
     case '{':
     case '[':
     case '(':
@@ -307,7 +309,7 @@ hdr_format_str (char *dest,
 
        p = dest;
 
-       cp = (op == 'd') ? (NONULL (DateFmt)) : src;
+       cp = (op == 'd' || op == 'D') ? (NONULL (DateFmt)) : src;
        if (*cp == '!')
        {
          do_locales = 0;
@@ -317,7 +319,7 @@ hdr_format_str (char *dest,
          do_locales = 1;
 
        len = destlen - 1;
-       while (len > 0 && ((op == 'd' && *cp) ||
+       while (len > 0 && (((op == 'd' || op == 'D') && *cp) ||
                           (op == '{' && *cp != '}') || 
                           (op == '[' && *cp != ']') ||
                           (op == '(' && *cp != ')') ||
@@ -362,7 +364,7 @@ hdr_format_str (char *dest,
        if (do_locales && Locale)
          setlocale (LC_TIME, Locale);
 
-       if (op == '[')
+       if (op == '[' || op == 'D')
          tm = localtime (&hdr->date_sent);
        else if (op == '(')
          tm = localtime (&hdr->received);