all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Bostjan Vilfan <bjvilfan@gmail.com>
Cc: 13982@debbugs.gnu.org
Subject: bug#13982: 24.2; Bug in function format-time-string when used under Windows
Date: Sun, 17 Mar 2013 20:47:26 +0200	[thread overview]
Message-ID: <837gl53ltt.fsf@gnu.org> (raw)
In-Reply-To: <CAAm34zqwPMi032YKGUsP7_SqN5VKON2Rqro5tbJb=2xPYx0b-w@mail.gmail.com>

> Date: Sat, 16 Mar 2013 10:51:18 +0200
> From: Bostjan Vilfan <bjvilfan@gmail.com>
> 
> 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.





  reply	other threads:[~2013-03-17 18:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-16  8:51 bug#13982: 24.2; Bug in function format-time-string when used under Windows Bostjan Vilfan
2013-03-17 18:47 ` Eli Zaretskii [this message]
2013-03-19 10:56   ` Bostjan Vilfan
2013-03-19 17:02     ` Eli Zaretskii
2013-03-19 20:08       ` Bostjan Vilfan
2013-03-19 20:58         ` Eli Zaretskii
2013-03-20  7:56           ` Bostjan Vilfan
2013-03-20 16:57             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837gl53ltt.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=13982@debbugs.gnu.org \
    --cc=bjvilfan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.