nmh-workers
[Top] [All Lists]

Re: displaying Date using local timezone

2021-03-18 10:08:34
bob wrote:
This thread and Ken's suggestion tempted me to fiddle with this
stuff, and I found that (zone) provides you your "standard time"
UTC offset (in minutes), regardless of (dst)'s result.  So, this,
grabbed from my mhl.format file, or something like it might
suffice for you:
...

I replied privately to Bob earlier, but wanted to close the loop.  I
believe his observation that "zone" doesn't change with "dst" solves
my twice-yearly problem, though I still have to hardcode my timezone. I
can live with that.

Here's what I have in mhl.headers, now:
;
; Show's sender's date optionally followed by an abbreviated translation.
; (i.e., it only translates to local if it wasn't in local to start with.)
; The number in the comparison "(ne -300)" is the local standard time zone
; offset in *minutes* from UTC.  So EST is -5 hours, or -300 minutes.
Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%(void(zone{text}))%<(ne
 -300) (Local: %(date2local{text})%(day{text}) %02(hour{text}):%02(min{text}) 
%(tzone{text}))%>%>"

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


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