unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>, 9794@debbugs.gnu.org
Subject: bug#9794: 24.0.90; `format-time-string' no good for %Z
Date: Thu, 20 Oct 2011 08:23:29 -0700	[thread overview]
Message-ID: <4EA03CF1.7070504@cs.ucla.edu> (raw)
In-Reply-To: <831uu7u8dw.fsf@gnu.org>

On 10/20/11 05:58, Eli Zaretskii wrote:
> current-time-zone
> can produce strings that are not RFC822 compliant, even on a Posix
> system, if the luser sets TZ to some arbitrary string.  Paul says that
> any software that uses the output of current-time-zone should be able
> to detect this non-compliance and use %z instead.

Perhaps I wasn't clear enough, as I didn't intend to imply anything
about detecting non-compliance.  Let me try to explain in more detail.

Software cannot simply use %Z and then filter out invalid strings,
because sometimes the %Z output can be a valid RFC822 string and
still be wrong.  For example, in eastern Australia the time zone
name is typically "EST", a valid RFC822 zone, but using "EST" is
wrong because RFC822 says EST is equivalent to 5 hours behind UTC,
whereas Australian EST is equivalent to 10 or 11 hours ahead of UTC.
An inhabitant of Sydney should put "+1000" or "+1100" in outgoing
email, not "EST".  (Australians commonly use the same abbreviation
for both Eastern Standard Time and Eastern Summer Time.)

The simplest way around the problem, which is what Emacs Lisp
code does now, is to follow Andreas's advice use %z.  Any
outside-of-Emacs Lisp code that uses %Z for RFC822 zones should
be fixed to use %z, because %Z does not work and has never worked
in general.

There are more-complicated solutions if you reeeeaaalllly want
the RFC822 symbolic names, but nobody uses them, for good reason.
In the email world, these symbolic names are obsolete, because
of problems like the above.  RFC2822, the successor to RFC822,
describes them in its section 4.3 ("Obsolete Date and Time"),
and says in section 1.3 that obsolete forms such as these
"MUST NOT be generated by creators of conformant messages".
Anybody who uses %Z to generate RFC822 headers is not conforming
to the current email standards, even if they are in the US eastern
time zone and are generating "EDT" and "EST".





  parent reply	other threads:[~2011-10-20 15:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-19  6:44 bug#9794: 24.0.90; `format-time-string' no good for %Z Drew Adams
2011-10-19  7:43 ` Drew Adams
2011-10-19  8:33   ` Eli Zaretskii
2011-10-19 13:20     ` Jason Rumney
2011-10-19 14:28       ` Drew Adams
2011-10-19 15:26       ` Eli Zaretskii
2011-10-19 16:08       ` Eli Zaretskii
2011-10-20  7:48         ` Paul Eggert
2011-10-20  9:24           ` Eli Zaretskii
2011-10-20  9:46             ` Andreas Schwab
2011-10-20 10:05               ` Eli Zaretskii
2011-10-20 10:10                 ` Andreas Schwab
2011-10-20 10:49                   ` Eli Zaretskii
2011-10-20 11:22                     ` Andreas Schwab
2011-10-20 12:58                       ` Eli Zaretskii
2011-10-20 13:06                         ` Andreas Schwab
2011-10-20 13:18                           ` Eli Zaretskii
2011-10-20 15:23                         ` Paul Eggert [this message]
2011-10-20 16:03                           ` Eli Zaretskii
2011-10-21 15:40             ` Jason Rumney
2011-10-21 17:34               ` Paul Eggert
2011-10-22  9:21               ` bug#641: " Eli Zaretskii
2011-10-19 14:29     ` Drew Adams
2011-10-19 15:13       ` Eli Zaretskii
2011-10-19  7:47 ` Eli Zaretskii
2011-10-19 14:28   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EA03CF1.7070504@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=9794@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).