[Users] A bug (?) in template %D{%Z} symbol expansion

pezcurrel pezcurrel at tiscali.it
Sun Nov 20 13:37:22 CET 2011


On Sat, 19 Nov 2011 15:36:47 +0100 pezcurrel <pezcurrel at tiscali.it> wrote:

> I guess the problem may be that strftime() nor any program can tell
> the exact tz acronym from the common "Date" header format, since it
> often only reports the timeshift from GMT
> [...]
> I think claws and/or strftime() should behave this way for %Z:
> 
> - if the "Date" header reports the acronym, print it
> - if it doesn't
>   - print the generic acronym for the given timeshift, like "EST" for "-0500", but I don't know if it's defined/definable somehow and in all cases, and if it's in all cases generic enough to cover all the different specific zones so...
>   - if "the most generic acronym for a timeshift" is undefined/undefineable or "not generic enough", print something like (eg) "UTC-5" or "GMT-5" for "-0500"

...but since...

- the only rfc including timezone abbreviations in "Date" header is obsolete (rfc 822), and it was limited to +0000 -0400 -0500 -0600 -0700 -0800 offsets
- the inclusion of abbreviation in a comment could be anywhere in the field body of the "Date" header
- the timezones and relative abbreviations for each offset are many, eg +0200 -> B (Bravo Time Zone), CAT (Central Africa Time), CEST (Central European Summer Time), EET (Eastern European Time), IST (Israel Standard Time), SAST (South Africa Standard Time), WAST (West Africa Summer Time), and there's no "geographically generic enough" timezone which include all the others for a given offset

...I think claws could behave this way for %Z in reply and forward templates, in order to avoid printing wrong "timezone strings" like "-0500 CET": "intercept" the format string before it is passed to strftime() and simply replace the offset from UTC (eg "-0500") with something like "UTC-05:00" (telling in the "description of symbols" window that %Z in %D will be treated "internally" this way); or maybe completely "disable" the %Z symbol for reply and forward templates.

A new "%localized_date_fmt" symbol could use every symbol from strftime(), %Z included, to show the original date converted to local timezone, but I would keep the current %D, since I think the original date is more useful and significant than a localized one in reply and forward templates.

Regards



More information about the Users mailing list