From: Toby Speight <Toby.Speight@streapadair.freeserve.co.uk>
Subject: Re: Time zone and 'lapsed under NT
Date: 12 Jul 1999 19:44:27 +0100 [thread overview]
Message-ID: <ur9mdyagk.fsf@lanber.cam.citrix.com> (raw)
In-Reply-To: Lars Magne Ingebrigtsen's message of "Fri, 09 Jul 1999 21:02:11 GMT"
Lars> Lars Magne Ingebrigtsen <URL:mailto:larsi@gnus.org>
0> Toby Speight <Toby.Speight@streapadair.freeserve.co.uk> writes:
>> The Emacs documentation doesn't describe (current-time) very well. It
>> says, "the current time, as the number of seconds since 1970-01-01
>> 00:00:00" - without specifying a time zone for that epoch...
0> In <URL:news:m3vhbtfsh5.fsf@quimbies.gnus.org>, Lars wrote:
Lars> (current-time-string (current-time))
Lars> => "Fri Jul 9 22:59:05 1999"
Lars>
Lars> which is the local time, here, now. (After fixing the clock.)
(current-time)
=> (14218 11870 732000)
(current-time-string '(14218 11870 732000))
=> "Mon Jul 12 19:05:18 1999"
That's local time for me, too (on NT). What I'm not sure about is
whether the representation of (current-time) is the same on both
platforms; it's possible that it is seconds-after-local-epoch on one
platform and seconds-after-UT-epoch on the other. If
(current-time-string) matches, you'd only see the difference if (a)
you transfer numeric times between the platforms or (b) you build a
numeric time from something other than (current-time). We're doing
(b). Just a theory. Can you report what (current-time-string '(14218
11870 732000)) gives you?
Lars> But what am I getting at? Uhm -- perhaps the bug isn't in the
Lars> generating-the-Data-header part, but in the parsing part?
I think perhaps it is:
(date-to-time "Thu, 01 Jan 1970 02:00:00 GMT")
=> (0 7200)
(date-to-time "Thu, 01 Jan 1970 02:00:00 EST")
=> (0 7200)
but:
(parse-time-string "Thu, 01 Jan 1970 02:00:00 GMT")
=> (0 0 2 1 1 1970 4 (0) 0)
(parse-time-string "Thu, 01 Jan 1970 02:00:00 EST")
=> (0 0 2 1 1 1970 4 (-18000) -18000)
So I suspect date-to-time, which is basically a wrapper around
encode-time. encode-time is a built-in function, so if this is
broken, it's an NTEmacs bug. BTW, I'm on GNU Emacs 20.3.1
(i386-*-nt4.0). Checking:
(encode-time 0 0 2 1 1 1970 4 '(0) 0)
=> (0 7200)
(encode-time 0 0 2 1 1 1970 4 '(-18000) -18000)
=> (0 7200)
Looks like that's our bug. A workaround ought to be possible, but
only by duplicating the broken functions. I don't have the time to do
it.
P.S. Lars, could you report this to the Emacs bug team? Ta. I guess
you'd better include the associated documentation bug (what zone is
the epoch?), too.
prev parent reply other threads:[~1999-07-12 18:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-09 15:23 Lars Magne Ingebrigtsen
1999-07-09 16:31 ` Toby Speight
1999-07-09 21:01 ` Lars Magne Ingebrigtsen
1999-07-12 18:37 ` Toby Speight
1999-07-15 11:55 ` Toby Speight
1999-08-27 17:57 ` Lars Magne Ingebrigtsen
1999-08-27 17:55 ` Lars Magne Ingebrigtsen
1999-07-12 18:44 ` Toby Speight [this message]
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=ur9mdyagk.fsf@lanber.cam.citrix.com \
--to=toby.speight@streapadair.freeserve.co.uk \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).