On Monday, 23 January, 2012 at 08:21:17 GMT, Sebastian Tramp wrote:
I'm looking for a way to convert the date header to my local time zone
in the mail detail view. I'm aware of the index format %D option but
need this for the (internal) pager.

Any ideas?

This is not fantastic, but it's worked for me:

Create a new script, eg. mutt_date_filter.pl:

---

#!/usr/bin/env perl

use strict;
use warnings;

while (<>) {
    s/\b(..., \d{1,2} ... \d{4} \d\d:\d\d:\d\d [+-]?\d{4})\b/my $d;chomp($d=`date -d 
"$1" +'%A, %d %B, %Y, %T %Z'`);$d/eg;
    print $_;
}

---

It looks for a string format matching that regex, and passes it to the 'date' 
command, which outputs it in your local time zone. I also told it to reformat 
it according to my own taste.

In .muttrc:

    set display_filter="mutt_date_filter.pl"

Make sure it's in your path.

--

.

Reply via email to