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)

> - A similar confusion exists between methods that return numbers and those
> that return strings.  This is obviously only an issue for days and months.

Exactly

> month/monname - abbreviated name (Jan Feb ...)
> fullmonth     - full name
> mon           - 1-12
> _mon          - 0-11

That might be a nice way to handle it if this is made abundantly clear
every time one of these things is referenced in the docs. Too many date
modules assume you know that things are 0 based. Or 1 based, as the case
might be.

-- 
And everyone said, "If we only live,
We too will go to sea in a Sieve -
To the hills of the Chankly Bore!"
 (The Jumblies, by Edward Lear)

Reply via email to