nmh-workers
[Top] [All Lists]

Re: displaying Date using local timezone

2021-03-16 14:49:32
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?

I ... THINK it might be possible?

Something like this, maybe (substitute -300 for your timezone offset in
minutes):

%(pretty{text})%(void(zone{text}))%<(ne -300)%(void(szone{text}))%<(eq 1) 
(Local: %(date2local{text})%(day{text}) %(hour{text}):%02(min{text}) 
%(tzone{text}))%>%>

You probably want to put a test for %(nodate) around that.  The idea is
you want to check the timezone before the call to date2local.

--Ken


<Prev in Thread] Current Thread [Next in Thread>