From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#9794: 24.0.90; `format-time-string' no good for %Z Date: Thu, 20 Oct 2011 08:23:29 -0700 Organization: UCLA Computer Science Department Message-ID: <4EA03CF1.7070504@cs.ucla.edu> References: <68A313A7DDAA4912A255DAFE495606F9@us.oracle.com> <24FDB65B0E784E978085D30A7CBF9FAF@us.oracle.com> <8362jlv0rq.fsf@gnu.org> <87fwipgltl.fsf@gnu.org> <83pqhtt144.fsf@gnu.org> <4E9FD232.9090502@cs.ucla.edu> <83botct3qv.fsf@gnu.org> <838vogt1tw.fsf@gnu.org> <837h40sztj.fsf@gnu.org> <831uu7u8dw.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1319124245 2351 80.91.229.12 (20 Oct 2011 15:24:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 20 Oct 2011 15:24:05 +0000 (UTC) Cc: Andreas Schwab , 9794@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 20 17:24:00 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RGuTP-0003Yk-12 for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2011 17:23:59 +0200 Original-Received: from localhost ([::1]:45203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGuTO-0001zJ-FS for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2011 11:23:58 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGuTL-0001ys-Gw for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2011 11:23:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGuTK-0005GX-55 for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2011 11:23:55 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGuTJ-0005GK-U5 for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2011 11:23:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RGuUQ-0007C4-2P for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2011 11:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Oct 2011 15:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9794 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Original-Received: via spool by 9794-submit@debbugs.gnu.org id=B9794.131912429327636 (code B ref 9794); Thu, 20 Oct 2011 15:25:02 +0000 Original-Received: (at 9794) by debbugs.gnu.org; 20 Oct 2011 15:24:53 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGuUG-0007Bh-OY for submit@debbugs.gnu.org; Thu, 20 Oct 2011 11:24:53 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGuUD-0007BO-DA for 9794@debbugs.gnu.org; Thu, 20 Oct 2011 11:24:51 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id D1504A60003; Thu, 20 Oct 2011 08:23:34 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J5kbtdc8g9jf; Thu, 20 Oct 2011 08:23:34 -0700 (PDT) Original-Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 5DCB1A60002; Thu, 20 Oct 2011 08:23:34 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Thunderbird/3.1.15 In-Reply-To: <831uu7u8dw.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 20 Oct 2011 11:25:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:52925 Archived-At: 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".