Ben Bennett <[EMAIL PROTECTED]> schrieb/wrote: > There is a related question about what I should _really_ be returning > for the reduced formats. For example, the format YYYY matches a year, > right now I return Jan 1st of the year, or YY gives a century, so if > given 20 I return Jan 1st, 2000. Does anyome have a suggestion for a > better return value?
Maybe we should have DateTime::Partial that can: . have a precision (like century, year, ISO week, etc.) . be in a reduced format. You could have a method that sets a "default date", i.e. fills the missig fields by looking at a reference date (with different modes). When used as a DateTime object, it just returns the lowest possible value (with a special handling of the year), e.g. a DT::P object with the value "2003-06" (precision: month) behaves like a DT object with the full date "2003-06-01T00:00:00.000000 (floating)". Claus -- http://www.faerber.muc.de