[ Soon the list archives will consistent entirely of me responding to
myself ... ]

On Sat, 11 Jan 2003, Dave Rolsky wrote:

> On Sat, 11 Jan 2003, Rich Bowen wrote:
>
> > On Fri, 10 Jan 2003, Dave Rolsky wrote:
> >
> > > Can we simply declare 0-based as the standard for day of week and day of
> > > year, and 1-based for day of month, month of year, and week of year.
> > > FWIW, that's what Date::ICal already had implemented, I believe.
> >
> > The reasoning here, although I don't know that we ever explicitly
> > discussed it is thus. Things should be 1-based if they are 1-based in
> > real usage. March 1 is the 1st day of the month, not the 0th. Calling
> > March 1 day 0 will inevitably confuse everyone who did not write the
> > module. Things should be 0 based if they are called by name in general
> > usage. Thus, day of week should probably be 0-based. Month is a little
> > less pleasant, but can be thought about thus. You usally use the month
> > number as a list index. Thus, Jan should be 0 because @months is (Jan,
> > Feb, etc)
>
> This is a really good way to look at it.  I think this can go into the
> module docs as is, along with an explicit list of which number-returning
> methods return 0-based, and which 1-based.

On second thought, I'm inclined to make an exception for month number,
just because we're so used to writing things like 2002-12-06.  Nobody
ever writes 2002-00-02 or something like that!


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to