Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1410 timedate shows wrong time

closed
nobody
Lisp Core (472)
5
2008-05-15
2008-05-05
Anonymous
No

timedate() function returns the result that is 1h behind the time of my system/hwclock.

Maxima version: 5.13.0
Maxima build date: 13:17 1/19/2008
host type: i686-pc-linux-gnu
lisp-implementation-type: GNU Common Lisp (GCL)
lisp-implementation-version: GCL 2.6.8

deshko@tut.by

Discussion

  • Raymond Toy
    Raymond Toy
    2008-05-05

    Logged In: YES
    user_id=28849
    Originator: NO

    timedate basically calls Lisp's get-decoded-time. If the time is wrong, it's a bug in your Lisp.

    Try this:

    :lisp (get-decoded-time)

    There should be 9 things printed. They are, sec, min, hour, date, month, year, day-of-week, daylight-savings-time-p, and tz. If they don't match the expected time, your Lisp is not producing the expected time.

    (FWIW, I get a time of "05:32:00 Tue, 5/06/2008 (GMT+9) with gcl, but cmucl and clisp say 16:36:54 Mon, 5/05/2008 (GMT-5). This is much closer to my real time.)

     
  • Raymond Toy
    Raymond Toy
    2008-05-05

    Logged In: YES
    user_id=28849
    Originator: NO

    timedate basically calls Lisp's get-decoded-time. If the time is wrong, it's a bug in your Lisp.

    Try this:

    :lisp (get-decoded-time)

    There should be 9 things printed. They are, sec, min, hour, date, month, year, day-of-week, daylight-savings-time-p, and tz. If they don't match the expected time, your Lisp is not producing the expected time.

    (FWIW, I get a time of "05:32:00 Tue, 5/06/2008 (GMT+9) with gcl, but cmucl and clisp say 16:36:54 Mon, 5/05/2008 (GMT-5). This is much closer to my real time.)

     
  • Raymond Toy
    Raymond Toy
    2008-05-05

    Logged In: YES
    user_id=28849
    Originator: NO

    timedate basically calls Lisp's get-decoded-time. If the time is wrong, it's a bug in your Lisp.

    Try this:

    :lisp (get-decoded-time)

    There should be 9 things printed. They are, sec, min, hour, date, month, year, day-of-week, daylight-savings-time-p, and tz. If they don't match the expected time, your Lisp is not producing the expected time.

    (FWIW, I get a time of "05:32:00 Tue, 5/06/2008 (GMT+9) with gcl, but cmucl and clisp say 16:36:54 Mon, 5/05/2008 (GMT-5). This is much closer to my real time.)

     
  • Robert Dodier
    Robert Dodier
    2008-05-15

    Logged In: YES
    user_id=501686
    Originator: NO

    timedate in src/commac.lisp now (r1.52) takes the daylight saving flag into account. The flag was ignored before, which introduces an error of 1 h when daylight saving time is in effect (e.g. summer months in USA). I don't know if daylight saving applies in Belarus.

    Here is the new version of timedate if someone wants to try it:

    (defun $timedate ()
    (multiple-value-bind (second minute hour date month year day-of-week dst-p tz)
    (get-decoded-time)
    (format nil "~2,'0d:~2,'0d:~2,'0d ~[Mon~;Tue~;Wed~;Thu~;Fri~;Sat~;Sun~], ~d/~2,'0d/~d (GMT~@d)"
    hour minute second day-of-week month date year (if dst-p (- 1 tz) (- tz)))))

    I'll close this report as fixed, which may be optimistic; we can reopen it or open a new one as needs be.

     
  • Robert Dodier
    Robert Dodier
    2008-05-15

    • status: open --> closed
     
  • Logged In: NO

    It seems that this is indeed the problem of lisp (gcl, actually). I tried to get timeoftheday in GCL and it gave me wrong (1h behind) time, while cmucl gave correct time. (I am in US now). So, this is not a maxima's bug. Thanks, guys.