GNU bug report logs - #5408
date-to-time problem

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Sun, 17 Jan 2010 23:14:01 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5408 in the body.
You can then email your comments to 5408 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Sun, 17 Jan 2010 23:14:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 17 Jan 2010 23:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Subject: date-to-time problem
Date: Mon, 18 Jan 2010 00:12:42 +0100
Evaluating this

   (current-time-string (date-to-time "Sun Jan 17 22:39:58 2010"))

Gives

   "Sun Jan 17 23:39:58 2010"

Is not this one hour wrong?

In GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
 of 2009-10-15




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Sun, 17 Jan 2010 23:54:02 GMT) Full text and rfc822 format available.

Message #8 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 00:53:01 +0100
Lennart Borgman <lennart.borgman <at> gmail.com> writes:

> Evaluating this
>
>    (current-time-string (date-to-time "Sun Jan 17 22:39:58 2010"))

This lacks a time zone, so GMT is assumed.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Sun, 17 Jan 2010 23:54:02 GMT) Full text and rfc822 format available.

Message #11 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Sun, 17 Jan 2010 18:53:45 -0500
Lennart Borgman <lennart.borgman <at> gmail.com> writes:

> Evaluating this
>
>    (current-time-string (date-to-time "Sun Jan 17 22:39:58 2010"))
>
> Gives
>
>    "Sun Jan 17 23:39:58 2010"
>
> Is not this one hour wrong?

Magic 8-ball says that you are living one time zone east of Greenwich.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Sun, 17 Jan 2010 23:55:01 GMT) Full text and rfc822 format available.

Message #14 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 00:53:32 +0100
On Mon, Jan 18, 2010 at 00:12, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> Is not this one hour wrong?

`date-to-time' calls `timezone-make-date-arpa-standard', but does not
pass it local timezone info, so it assumes GMT.

Compare

ELISP> (timezone-make-date-arpa-standard "Sun Jan 17 22:39:58 2010")
"17 Jan 2010 23:39:58 +0100"
ELISP> (timezone-make-date-arpa-standard "Sun Jan 17 22:39:58 2010" "GMT+1")
"17 Jan 2010 22:39:58 +0100"

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 00:01:02 GMT) Full text and rfc822 format available.

Message #17 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 01:00:23 +0100
On Mon, Jan 18, 2010 at 12:53 AM, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Mon, Jan 18, 2010 at 00:12, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> Is not this one hour wrong?
>
> `date-to-time' calls `timezone-make-date-arpa-standard', but does not
> pass it local timezone info, so it assumes GMT.
>
> Compare
>
> ELISP> (timezone-make-date-arpa-standard "Sun Jan 17 22:39:58 2010")
> "17 Jan 2010 23:39:58 +0100"
> ELISP> (timezone-make-date-arpa-standard "Sun Jan 17 22:39:58 2010" "GMT+1")
> "17 Jan 2010 22:39:58 +0100"


Ok, thanks for all the answers.

But date-to-time does not say that it assumes GMT.

And current-time-string does not say it will give my local time.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 15:11:01 GMT) Full text and rfc822 format available.

Message #20 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 16:09:52 +0100
On Mon, Jan 18, 2010 at 01:00, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> But date-to-time does not say that it assumes GMT.

No. Perhaps it should.

> And current-time-string does not say it will give my local time.

It seems fair to default to your local timezone. Note that there's
also a `current-time-zone', so

ELISP> (current-time-zone)
(3600 "+0100")

ELISP> (current-time-zone (date-to-time "Sun Jan 17 22:39:58 2010"))
(3600 "+0100")

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 15:13:02 GMT) Full text and rfc822 format available.

Message #23 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 16:11:57 +0100
On Mon, Jan 18, 2010 at 4:09 PM, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Mon, Jan 18, 2010 at 01:00, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> But date-to-time does not say that it assumes GMT.
>
> No. Perhaps it should.

Yes.

>> And current-time-string does not say it will give my local time.
>
> It seems fair to default to your local timezone. Note that there's
> also a `current-time-zone', so

It would be much more fair if it told so. That would make the
difference more obvious.

> ELISP> (current-time-zone)
> (3600 "+0100")
>
> ELISP> (current-time-zone (date-to-time "Sun Jan 17 22:39:58 2010"))
> (3600 "+0100")
>
>    Juanma
>




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 15:21:07 GMT) Full text and rfc822 format available.

Message #26 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 16:19:46 +0100
On Mon, Jan 18, 2010 at 16:11, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> It would be much more fair if it told so. That would make the
> difference more obvious.

Doc patches welcome.

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 15:27:13 GMT) Full text and rfc822 format available.

Message #29 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 16:26:14 +0100
On Mon, Jan 18, 2010 at 4:19 PM, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Mon, Jan 18, 2010 at 16:11, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> It would be much more fair if it told so. That would make the
>> difference more obvious.
>
> Doc patches welcome.

Can't you please just put in the remarks? In a case like this it is
more effective I think.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 15:43:03 GMT) Full text and rfc822 format available.

Message #32 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 16:41:49 +0100
On Mon, Jan 18, 2010 at 16:26, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> Can't you please just put in the remarks? In a case like this it is
> more effective I think.

Remarks? If it is causing confusion to users of the functions, it
should be documented.

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 16:30:04 GMT) Full text and rfc822 format available.

Message #35 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: Lennart Borgman <lennart.borgman <at> gmail.com>, 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 11:29:41 -0500
Juanma Barranquero <lekktu <at> gmail.com> writes:

> On Mon, Jan 18, 2010 at 16:26, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> Can't you please just put in the remarks? In a case like this it is
>> more effective I think.
>
> Remarks? If it is causing confusion to users of the functions, it
> should be documented.

I think he meant "can't *you* please just put in the remarks".  Anyhow,
I've checked in the dox fixes now.




bug closed, send any further explanations to Lennart Borgman <lennart.borgman <at> gmail.com> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Mon, 18 Jan 2010 16:30:05 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 16:33:02 GMT) Full text and rfc822 format available.

Message #40 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 17:31:37 +0100
On Mon, Jan 18, 2010 at 5:29 PM, Chong Yidong <cyd <at> stupidchicken.com> wrote:
> Juanma Barranquero <lekktu <at> gmail.com> writes:
>
>> On Mon, Jan 18, 2010 at 16:26, Lennart Borgman
>> <lennart.borgman <at> gmail.com> wrote:
>>
>>> Can't you please just put in the remarks? In a case like this it is
>>> more effective I think.
>>
>> Remarks? If it is causing confusion to users of the functions, it
>> should be documented.
>
> I think he meant "can't *you* please just put in the remarks".  Anyhow,
> I've checked in the dox fixes now.

Yes ;-)

Thanks.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 16:33:02 GMT) Full text and rfc822 format available.

Message #43 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Lennart Borgman <lennart.borgman <at> gmail.com>, 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 17:32:32 +0100
On Mon, Jan 18, 2010 at 17:29, Chong Yidong <cyd <at> stupidchicken.com> wrote:

> I think he meant "can't *you* please just put in the remarks".

Ah. Why would it be more effective that *I* do it, instead of doing it himself?

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 16:44:02 GMT) Full text and rfc822 format available.

Message #46 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: Chong Yidong <cyd <at> stupidchicken.com>, 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 17:42:37 +0100
On Mon, Jan 18, 2010 at 5:32 PM, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Mon, Jan 18, 2010 at 17:29, Chong Yidong <cyd <at> stupidchicken.com> wrote:
>
>> I think he meant "can't *you* please just put in the remarks".
>
> Ah. Why would it be more effective that *I* do it, instead of doing it himself?

Logistics. I do not commit anything.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 16:47:01 GMT) Full text and rfc822 format available.

Message #49 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Chong Yidong <cyd <at> stupidchicken.com>, 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 17:45:30 +0100
On Mon, Jan 18, 2010 at 17:42, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> Logistics. I do not commit anything.

AFAIK, you have commit rights, so not commiting anything makes things
more effective for you, less effective for others.

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 16:48:01 GMT) Full text and rfc822 format available.

Message #52 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: Chong Yidong <cyd <at> stupidchicken.com>, 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 17:47:32 +0100
On Mon, Jan 18, 2010 at 5:45 PM, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Mon, Jan 18, 2010 at 17:42, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> Logistics. I do not commit anything.
>
> AFAIK, you have commit rights, so not commiting anything makes things
> more effective for you, less effective for others.

My conclusion have been that I make it more effective for us all if I
do not commit. ;-)

But I will try to change my mind.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5408; Package emacs. (Mon, 18 Jan 2010 16:58:01 GMT) Full text and rfc822 format available.

Message #55 received at 5408 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Chong Yidong <cyd <at> stupidchicken.com>, 5408 <at> debbugs.gnu.org
Subject: Re: bug#5408: date-to-time problem
Date: Mon, 18 Jan 2010 17:56:43 +0100
On Mon, Jan 18, 2010 at 17:47, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> My conclusion have been that I make it more effective for us all if I
> do not commit. ;-)

Well, IMHO, if you want something changed and don't want to commit,
you can at least send patches and ChangeLog entries.

    Juanma




bug archived. Request was from Debbugs Internal Request <bug-gnu-emacs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 16 Feb 2010 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 130 days ago.

Previous Next


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