On Sun, 6 Aug 2000, Tom Hughes wrote:

> In message <[EMAIL PROTECTED]>
>           [EMAIL PROTECTED] (Johan Vromans) wrote:
> 
> > I'd argue that
> >
> >     ($year, $mon, $mday, $hour, $min, $sec, $msec, $nsec,
> >
> > is much easier to remember, since it is a series of continuous
> > decrasing magnitudes.
> 
> I was thinking much the same. It also means you can sort the
> dates to whatever accuracy you want by comparing each of the
> first n elements in turn for some value of n defined bu the
> accuracy you want.
> 

I agree on the order but if its done right you should not have to
do a element by element comparison. You simply need to create a
date() object with your comparison date in it and overload the > 
and < operators so that you can do

  if ( $date1 > $date2 ) {
     ...
  }

On a related point, since the 0 indexed parts of local time were there
specifically for easy access into an array to retrieve the string form
would there be a method to return the month name directly without having
to do an explicit lookup (I imagine the format() part will handle this).
Is the intention to allow the stringification to know about different
languages?

Also, I would vote for a method to return the Julian date (yes I am an
astronomer...) :-)

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


Reply via email to