nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

displaying Date using local timezone


From: Paul Fox
Subject: displaying Date using local timezone
Date: Tue, 16 Mar 2021 14:26:53 -0400

There was a quite a thread on this topic back in 12/2014, which was useful to
me this morning when I went looking for a way to get show and scan to show me
dates in the local timezone.

My solution looks like this, thanks to an example that Ken provided back then.
(Line broken up for readability.)

; Normal.  Shows sender's date.
; Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>"
; This shows sender's date translated to local time instead.
; 
Date:formatfield="%<(nodate{text})%{text}%|%(date2local{text})%(pretty{text})%>"
; This show's sender's date followed by a translation to local time, 
abbreviated.
Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%(void(szone{text}))\
%<(eq 1) (Local: %(date2local{text})%(day{text}) \
%(hour{text}):%02(min{text}) %(tzone{text}))%>%>"

This works well, and does this for me:
Date:    Mon, 21 Sep 2020 16:03:17 +0200 (Local: Mon 10:03 -0400)

However, it also does this, i.e., it duplicates the date when there's no need.
Date:    Mon, 15 Mar 2021 11:39:04 -0400 (Local: Mon 11:39 -0400)

I took a look at trying to suppress the extra output if the timezone is already
the same as my local zone, but as far as I can tell, it's not possible.  There's
no way to get access to the original timezone and the local timezone at the
same time, since once you run date2local, the original is gone.

Am I right about this?

paul
=----------------------
 paul fox, pgf@foxharp.boston.ma.us (arlington, ma, where it's 36.5 degrees)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]