From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#641: format-time-string %Z does not work, starting with Emacs 22.2 Date: Tue, 05 Aug 2008 21:34:35 +0300 Message-ID: References: <4897737C.90709@gmx.at> <001501c8f67e$7c63b300$0200a8c0@us.oracle.com> Reply-To: Eli Zaretskii , 641@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1217962096 20063 80.91.229.12 (5 Aug 2008 18:48:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Aug 2008 18:48:16 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 05 20:49:06 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KQRai-0002S2-RT for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2008 20:49:05 +0200 Original-Received: from localhost ([127.0.0.1]:60571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQRZn-0000mv-Oy for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2008 14:48:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQRZJ-0000KK-Us for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2008 14:47:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQRZI-0000Hq-44 for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2008 14:47:37 -0400 Original-Received: from [199.232.76.173] (port=53577 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQRZH-0000G9-LI for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2008 14:47:35 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:35434) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KQRZF-0007rv-7t for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2008 14:47:33 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m75IlMe9012492; Tue, 5 Aug 2008 11:47:23 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m75Ie6Ci009967; Tue, 5 Aug 2008 11:40:06 -0700 X-Loop: don@donarmstrong.com Resent-From: Eli Zaretskii Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , don@donarmstrong.com Resent-Date: Tue, 05 Aug 2008 18:40:06 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 641 X-Emacs-PR-Package: emacs,w32 X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12179613219408 (code B ref -1); Tue, 05 Aug 2008 18:40:06 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 5 Aug 2008 18:35:21 +0000 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m75IZBlS008939 for ; Tue, 5 Aug 2008 11:35:13 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQRNF-0006eA-Iw for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2008 14:35:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQRNC-0006dy-GZ for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2008 14:35:08 -0400 Original-Received: from [199.232.76.173] (port=53657 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQRNC-0006dv-Ap for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2008 14:35:06 -0400 Original-Received: from mtaout4.012.net.il ([84.95.2.10]:55841) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KQRNB-0005xp-LK for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2008 14:35:06 -0400 Original-Received: from HOME-C4E4A596F7 ([77.126.7.152]) by i_mtaout4.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K5500L034Y1E980@i_mtaout4.012.net.il> for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2008 21:34:49 +0300 (IDT) In-reply-to: <001501c8f67e$7c63b300$0200a8c0@us.oracle.com> X-012-Sender: halo1@inter.net.il X-detected-kernel: by monty-python.gnu.org: Solaris 9.1 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Tue, 05 Aug 2008 14:47:37 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19044 Archived-At: > From: "Drew Adams" > Date: Mon, 4 Aug 2008 15:07:28 -0700 > Cc: > > > From: martin rudalics Sent: Monday, August 04, 2008 2:24 PM > > > emacs -Q > > > M-: (format-time-string "%Z) ==> "" > > > M-: (format-time-string "%z) ==> "-0700" > > > > > > The %Z string is incorrect. In my case, it should be (as it is in > > > Emacs 20 and Emacs 22.1): "Pacific Daylight Time". > > > > > > This same bug appears in Emacs 23. This is a regression from Emacs > > > 22.1. > > > > See > > 2007-06-07 Jason Rumney > > * s/ms-w32.h: Don't define HAVE_TZNAME. > > * editfns.c (Fcurrent_time_zone): Remove hack for > > Japanese Windows. > > > > and the preceding discussion starting with > > http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html > > Sorry; I don't know what all of that means. What it means is that we did this on purpose, and therefore the fact you get an empty string for %Z is not a bug. > It is obviously a bug, however, that %Z produces an empty time-zone string. I > use it for a time stamp, for instance, with this form: > (format-time-string "%a %b %e %T %Y (%Z)") > > After the change that introduced the bug, I get this: > > Mon Aug 4 15:01:16 2008 () > > instead of this: > > Mon Aug 4 15:01:16 2008 (Pacific Daylight Time) "Pacific Daylight Time" is not a Posix- or RFC-822 compliant timezone specification. It comes from the MS-Windows version of `tzname', which produces RFC-compliant TZ strings only for a very small subset of timezone specifications, and even that only after you call `tzset' from within an application. So we disabled the use of `tzname' on Windows to avoid producing non-compliant timezone strings, which could break others, e.g. if used in an email message header. Posix specifies that if `tzname' is not available, %Z should produce an empty string. This means that an empty string is a valid result of format-time-string for %Z, and if you use %Z in your Lisp code, you should make allowances for the case of an empty string, no matter on which platform.