On Fri, 11 Aug 2000, Nathan Wiger wrote:

> > Adding support for (modified) Julian Date will be much more
> > generic and remove dependency on unix epoch with little
> > extra code.
> 
> To me, the real question is which date() should we use:
> 
>    $date = date $seconds_since_epoch;   # uses time()
>    $date = date $modified_julian_date;  # non-Unix

This would be fine so long as time() returned an MJD rather than seconds
(or another function was supplied for returning the current time).

I was not really proposing that seconds should be dropped just that MJD is
an alternative (the other difference is that unix time is an integer and 
MJD has to be a double).

> 
> If we can make it work, the second one seems a lot more
> platform-independent. After all, the epoch has no meaning to those on
> Macs, PCs, or BeOS machines (except maybe historical trivia).
> 
> Are we agreed that date() should now be based on Julian date? Here's the
> advantages:
> 
>    1. Unix-independent (yeah, I love Unix, but...)
> 
>    2. Allows easy date arithmetic (complex -> module)
> 

It should be possible to do date arithmetic with the seconds returned by
time()

   $tomorrow = time() + 24*60*60;

so the second point is not really an advantage. The main issue is that
date() has a method for returning some number such as this that will allow
for easy date arithmetic. MJD has a more generic feel.


> And here's the disadvantages:
> 
>    1. Unix time() no longer the basis for date
> 
> Although that really isn't a disadvantage, just a difference.

Indeed.

-- 
Tim Jenness
JCMT software engineer/Support scientist
http://www.jach.hawaii.edu/~timj


Reply via email to