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#13982: 24.2; Bug in function format-time-string when used under Windows Date: Sun, 17 Mar 2013 20:47:26 +0200 Message-ID: <837gl53ltt.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1363546123 4478 80.91.229.3 (17 Mar 2013 18:48:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Mar 2013 18:48:43 +0000 (UTC) Cc: 13982@debbugs.gnu.org To: Bostjan Vilfan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 17 19:49:08 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 1UHIdn-0008Cs-3d for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Mar 2013 19:49:07 +0100 Original-Received: from localhost ([::1]:46999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHIdQ-0007Kz-5p for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Mar 2013 14:48:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHIdL-0007Kj-9E for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 14:48:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHIdG-0007kt-5W for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 14:48:39 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHIdG-0007kn-29 for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 14:48:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UHIeg-0000OD-9g for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 14:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Mar 2013 18:50: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.13635461721453 (code B ref 13982); Sun, 17 Mar 2013 18:50:02 +0000 Original-Received: (at 13982) by debbugs.gnu.org; 17 Mar 2013 18:49:32 +0000 Original-Received: from localhost ([127.0.0.1]:60273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHIeA-0000NM-7j for submit@debbugs.gnu.org; Sun, 17 Mar 2013 14:49:31 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:58135) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHIe1-0000Mw-9o for 13982@debbugs.gnu.org; Sun, 17 Mar 2013 14:49:23 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MJT00800ICHG300@a-mtaout20.012.net.il> for 13982@debbugs.gnu.org; Sun, 17 Mar 2013 20:47:21 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MJT008U3IUXPU00@a-mtaout20.012.net.il>; Sun, 17 Mar 2013 20:47:21 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il 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:72648 Archived-At: > 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.