From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bostjan Vilfan Newsgroups: gmane.emacs.bugs Subject: bug#13982: 24.2; Bug in function format-time-string when used under Windows Date: Tue, 19 Mar 2013 12:56:30 +0200 Message-ID: References: <837gl53ltt.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1363690661 17780 80.91.229.3 (19 Mar 2013 10:57:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Mar 2013 10:57:41 +0000 (UTC) Cc: 13982@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 19 11:58:05 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UHuF1-0003Y6-Fu for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Mar 2013 11:58:03 +0100 Original-Received: from localhost ([::1]:47848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHuEd-0008M8-I4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Mar 2013 06:57:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHuEW-0008Lq-LD for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 06:57:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHuEO-0004cI-TV for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 06:57:32 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHuEO-0004cC-Pe for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 06:57:24 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UHuFy-0006BU-Qx for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 06:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bostjan Vilfan Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Mar 2013 10:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13982 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13982-submit@debbugs.gnu.org id=B13982.136369069423654 (code B ref 13982); Tue, 19 Mar 2013 10:59:02 +0000 Original-Received: (at 13982) by debbugs.gnu.org; 19 Mar 2013 10:58:14 +0000 Original-Received: from localhost ([127.0.0.1]:35039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHuFB-00069R-Dp for submit@debbugs.gnu.org; Tue, 19 Mar 2013 06:58:13 -0400 Original-Received: from mail-vc0-f177.google.com ([209.85.220.177]:54869) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHuF7-00069F-RI for 13982@debbugs.gnu.org; Tue, 19 Mar 2013 06:58:11 -0400 Original-Received: by mail-vc0-f177.google.com with SMTP id ia10so234963vcb.8 for <13982@debbugs.gnu.org>; Tue, 19 Mar 2013 03:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=RefVkl1EdSq7B1FNJ1EAK/4Xlg0PRmLxOs2FAIJ1fsM=; b=cJj9rNXKqjV+m01s8qNV19fLG6Xdqpazgujo5/ge3G4+PNJYzACU8LqMk9EKNVvmef JhPRG2T5uSjTMRI2k3buI+Z7VqwdKhIixnvfAG7wgbpGuPHz4D5ecBHIUi0n/oBcQoDo ygUNvCF2Rx2q2wodOOSxI8KpooJxh94oemco9/jOhH0uBhuKkWJRRine67go6ipvPgGs DeUyz6ET5Rjl63TR97a3MPnYZ5PO99Kn5ecGckcZ1ebOurCcBcrIU4WrU3H84FZ6WAII X/xadizUVoeAd1tTDt6jbb/ssmZHSVbV0mW8L9D1DDNQevuixD7++J4UzH71O35CONYP c0ww== X-Received: by 10.220.223.80 with SMTP id ij16mr1896345vcb.28.1363690590310; Tue, 19 Mar 2013 03:56:30 -0700 (PDT) Original-Received: by 10.52.91.42 with HTTP; Tue, 19 Mar 2013 03:56:30 -0700 (PDT) In-Reply-To: <837gl53ltt.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:72701 Archived-At: On Sun, Mar 17, 2013 at 8:47 PM, Eli Zaretskii wrote: >> Date: Sat, 16 Mar 2013 10:51:18 +0200 >> From: Bostjan Vilfan >> >> When the function format-time-string is tested under Linux after calling, >> e.g., "emacs -Q" by evaluating the form >> >> "(format-time-string \"%H:%M\")" >> >> one gets the expected answer, i.e., the current local time since the two >> above mentioned variables are undefined. >> >> However, when the same is performed under Windows, Emacs uses daylight >> savings with start and end corresponding to Cambridge, Massachusetts, in >> spite of the fact that the two previously mentioned variables are undefined. >> In my case I evaluated the above form at 9:47 AM local time but received the >> output 10:47, presumably because daylight savings time is already in force >> in Cambridge, Massachusetts, although not in the Central European Time area. > > I don't think this has anything to do with either cal-dst or with any > of the calendar-daylight-savings-* variables. format-time-string > doesn't look at any of that stuff. It's all between Emacs and your > OS. > > FWIW, I cannot reproduce this on any Windows machine to which I have > access (which includes Windows 7 and a couple of XP boxes). In my > time zone, the DST is not yet in effect, either, but I don't see any > "Cambridge, Massachusetts" effect on the time string produced by > format-time-string. I get the correct local time, the same one shown > by the OS on the task bar. > > Please tell what do you get if you type the following in "emacs -Q", > without loading anything, neither cal-dst nor your sample init.el: > > M-: (format-time-string "%H:%M %z %Z") RET > > Please also tell whether the result of the above matches the time zone > you defined for your system (which can be seen by double-clicking on > the time display in the task bar). > >> Yet that is not all. (We are still refering to an installation of Emacs >> under Windows.) If one creates a small init.el file with the following >> contents: >> >> START OF FILE >> (load "cal-dst") >> >> (setq calendar-daylight-savings-starts '(calendar-nth-named-day -1 0 3 year)) >> ;(setq calendar-daylight-savings-starts nil) >> (setq calendar-daylight-savings-ends '(calendar-nth-named-day -1 0 10 year)) >> ;(setq calendar-daylight-savings-ends nil) >> (setq calendar-daylight-time-offset 60) >> (setq calendar-daylight-savings-starts-time 180) >> (setq calendar-daylight-savings-ends-time 180) >> END OF FILE >> >> and invokes emacs with "runemacs --no-splash --no-site-file" (in that >> case the init.el will be executed), after which one evaluates the same >> form as before, one still gets the Cambridge, Massachusetts version of >> daylight savings. In other words, the two above mentioned variables have >> no effect. > > That's right, they have no effect and _should_ have no effect. So in > this part Emacs is surely behaving as expected. The only problem > seems to be that Emacs thinks you are one hour ahead of your local > time, for some as yet unknown reason. Hello, and thanks for your message. I did as per your instructions, and the value of (format-time-string "%H:%M %z %Z") is "12:30 +0200 CDT" (actual local time was 11:30; so in other words emacs thinks local time is 1 hour ahead of actual local time) Your remark that all your Windows machines give the correct answer indicates that there must be some settings on my computer that is at fault; but I have no idea what that is. I made one additional experiment: the version of emacs I was using was a modification by Vincent Goulet (http://vgoulet.act.ulaval.ca/en/emacs/). I thought that in some way that version made some hidden changes, so I completely uninstalled it, and installed the version obtainable from the GNU site. The result of evaluating the above form was the same. Regards, Bostjan