GNU bug report logs - #641
format-time-string %Z does not work, starting with Emacs 22.2

Previous Next

Packages: emacs, w32;

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

Date: Fri, 1 Aug 2008 16:55:06 UTC

Severity: wishlist

Merged with 9794

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


Message #21 received at 641 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'martin rudalics'" <rudalics <at> gmx.at>, <641 <at> debbugs.gnu.org>
Subject: RE: bug#641: format-time-string %Z does not work,starting with Emacs 22.2
Date: Mon, 4 Aug 2008 15:07:28 -0700
> 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  <jasonr <at> gnu.org>
> 	* 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.

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)

The doc string for `format-time-string' says that "%Z is the time zone name". My
time zone name is "Pacific Daylight Time" (or something similar). It is
certainly not "".






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

Previous Next


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