<<< Date Index >>>     <<< Thread Index >>>

Re: Setting timezone to local timezone



On Wed, Jan 31, 2007 at 10:51:24AM -0500, Kyle Wheeler wrote:
> >>     #!/bin/bash
> >>     # save the message to a file
> >>     cat - > /tmp/timezoneconvert.$$
> >>     # extract the date header
> >>     thedate=$( awk '/^Date: / && !i { $1="" ; print $0 ; i=1}' )
> >>     # convert to the current timezone (defined by TZ)
> >>     thedate=$( date -d "$thedate" )
> >>     # output the modified message
> >>     awk "{ if (/^Date: /) print \"Date: $thedate\"; else print $0; }" \
> >>         </tmp/timezoneconvert.$$
> >>     # clean up
> >>     rm /tmp/timezoneconvert.$$
> 
> Say that script is named ~/bin/convertdate.sh, you would then add the 
> following to your muttrc:
> 
>     set display_filter=$HOME/bin/convertdate.sh

Neat, I didn't know about display_filter.

Maybe I can use it to join URLs that span lines
(or substitute tinyurl or other short mappings).

By the way, for security reasons, if you're making temp files,
you should probably use a tmp dir in your home, and/or mktemp
for creating the filenames and such.
-- 
The driving force behind innovation is sublimation.
-><- <URL:http://www.subspacefield.org/~travis/>
For a good time on my UBE blacklist, email john@xxxxxxxxxxxxxxxxxx

Attachment: pgp1JWjdag00I.pgp
Description: PGP signature