GNU bug report logs - #22302
25.1.50; time-stamp ignores time-stamp-time-zone

Previous Next

Package: emacs;

Reported by: Harald Hanche-Olsen <hanche <at> math.ntnu.no>

Date: Mon, 4 Jan 2016 00:20:02 UTC

Severity: normal

Found in version 25.1.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Harald Hanche-Olsen <hanche <at> math.ntnu.no>
Subject: bug#22302: closed (Re: bug#22302: 25.1.50; time-stamp ignores
 time-stamp-time-zone)
Date: Tue, 12 Jan 2016 17:15:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#22302: 25.1.50; time-stamp ignores time-stamp-time-zone

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 22302 <at> debbugs.gnu.org.

-- 
22302: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22302
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 22302-done <at> debbugs.gnu.org, Harald Hanche-Olsen <hanche <at> math.ntnu.no>
Subject: Re: bug#22302: 25.1.50; time-stamp ignores time-stamp-time-zone
Date: Tue, 12 Jan 2016 09:14:49 -0800
[Message part 3 (text/plain, inline)]
On 01/11/2016 08:40 PM, Glenn Morris wrote:
> Harald Hanche-Olsen wrote:
>
>> Run emacs -Q and insert this text:
>> Time-stamp: <>
>>
>> Then do:
>> M-: (require 'time-stamp) RET
>> M-x set-variable RET time-stamp-time-zone RET "UTC" RET
>> M-x time-stamp
>>
>> Expected result: A UTC time stamp is inserted.
>> Actual result: A time stamp in the local time zone is inserted.
> This is due to af32fa956. Paul, could you have a look please?

Thanks for reporting this. I fixed the bug by installing the attached 
patch to emacs-25.

By the way, the value "UTC" is not portable to non-GNU systems, and 
POSIX says that in theory it could cause Emacs to crash. The value 
should be "UTC0" or (in Emacs 25) t. I see that some of Emacs's own 
source files have this issue, and plan to look into that.
[0001-Fix-time-stamp-time-zone-bugs-introduced-in-July.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Harald Hanche-Olsen <hanche <at> math.ntnu.no>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 25.1.50; time-stamp ignores time-stamp-time-zone
Date: Mon, 4 Jan 2016 00:18:52 +0000
Run emacs -Q and insert this text:
Time-stamp: <>

Then do:
M-: (require 'time-stamp) RET
M-x set-variable RET time-stamp-time-zone RET "UTC" RET
M-x time-stamp

Expected result: A UTC time stamp is inserted.
Actual result: A time stamp in the local time zone is inserted.

My analysis:
time-stamp uses time-stamp-string to compute the string to insert.
And that calls:
      (format-time-string (time-stamp-string-preprocess ts-format)
                          nil time-stamp-time-zone)
However, time-stamp-string-preprocess does all the work,
leaving nothing for format-time-string to do.
And it does so without consulting time-stamp-time-zone.

Admittedly, the doc string for time-stamp (no longer?) mentions time-stamp-time-zone.
However, the variable does exist, and its doc string indicates that it will be used by time-stamp.

– Harald

In GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.2.0, NS appkit-1404.34 Version 10.11.2 (Build 15C50))
 of 2015-12-17
Repository revision: 23b5c22703eeee7b4fe6608ce12ffe3b87794933
Windowing system distributor 'Apple', version 10.3.1404
Configured using:
 'configure --with-ns'

Configured features:
RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Important settings:
  value of $LC_CTYPE: en_US.UTF-8
  locale-coding-system: utf-8-unix



This bug report was last modified 9 years and 127 days ago.

Previous Next


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