[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SRFI-19 bug: date->julian-day not inverse of julian-day->date
From: |
Jon Wilson |
Subject: |
SRFI-19 bug: date->julian-day not inverse of julian-day->date |
Date: |
Wed, 27 Jun 2007 16:45:42 -0400 |
User-agent: |
Thunderbird 1.5.0.12 (X11/20070604) |
Hi,
Take a gander:
guile> (date->string (current-date))
"Wed Jun 27 16:39:42-0400 2007"
guile> (date->string (julian-day->date (date->julian-day (current-date))))
"Wed Jun 27 12:39:43-0400 2007"
Offset by four hours from one another. Of course, the four hours comes
from the -0400 time zone. But clearly one of the two functions is
taking the time zone into account in a different manner from the other
function, leading to this discrepancy.
Similarly:
guile> (exact->inexact (current-julian-day ))
2454279.36203873
guile> (exact->inexact (date->julian-day (julian-day->date
(current-julian-day ))))
2454279.19553665
Nothing changes if I add the timezone specification to the
julian-dat->date function: (julian-day->date X -14400). I'm going to go
look at SRFI-19, and see if I can figure out if this is really a bug or
a design flaw. If it is a bug, I'll take a look at fixing it and
submitting a patch soon.
Regards,
Jon
- SRFI-19 bug: date->julian-day not inverse of julian-day->date,
Jon Wilson <=