GNU bug report logs - #9794
24.0.90; `format-time-string' no good for %Z

Previous Next

Packages: w32, emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Wed, 19 Oct 2011 06:46:02 UTC

Severity: wishlist

Merged with 641

Found in versions 22.2, 23.0.60, 24.0.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jason Rumney <jasonr <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 9794 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: bug#9794: 24.0.90; `format-time-string' no good for %Z
Date: Fri, 21 Oct 2011 23:40:20 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>>     Any code that assumes that (format-time-string "%Z") must generate
>>     an RFC822 zone is making an unwarranted assumption and should be
>>     fixed.
>
> Fixed how?  Given some arbitrary string, how can Lisp code check
> whether it is or isn't compliant?  Non-ASCII characters are easy to
> check, but what about time zones that include only ASCII characters?

Lisp code that needs RFC822 compliance should just use %z.  Only a small
subset of timezone abbreviations are allowed by RFC822:

zone        =  "UT"  / "GMT"                ; Universal Time
                                            ; North American : UT
            /  "EST" / "EDT"                ;  Eastern:  - 5/ - 4
            /  "CST" / "CDT"                ;  Central:  - 6/ - 5
            /  "MST" / "MDT"                ;  Mountain: - 7/ - 6
            /  "PST" / "PDT"                ;  Pacific:  - 8/ - 7
            /  1ALPHA                       ; Military: Z = UT;
                                            ;  A:-1; (J not used)
                                            ;  M:-12; N:+1; Y:+12
            / ( ("+" / "-") 4DIGIT )        ; Local differential
                                            ;  hours+min. (HHMM)

So Paul is probably correct - we should not worry about RFC / POSIX or
whatever compliance for %Z.

> Jason, can you point out which package(s) needed an RFC822-compliant
> time zone name?  In the mail exchange I found, you just say
>
>   [...] since the result of current-time-zone is used for mail
>   headers, where non-ASCII characters are not allowed, and the POSIX
>   timezone names are expected [...]

A translation of the original report is here:
 http://www.m17n.org/mlarchive/mule-ja/200102/msg00072.html

The original problem leading to that report seems to have been observed
in a beta version of mew:
 http://groups.yahoo.co.jp/group/emacs21-users-ja/message/42





This bug report was last modified 13 years and 271 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.