> Have a look at DateTime::Incomplete.
it doesn't parse. as you identify, the key question is how to get the format modules to use it instead.
Of course, DateTime::Format::ISO8601 still sets a default if you use it to parse the datetime. (Joshua: You accept a DateTime object for filling in missing parts; is there any chance you could also accept a DateTime::Incomplete object? If such an object is supplied, your parser would return a DT:I object)
Initial experiments suggest not:
Sorry Mark, that was meant as a question for Joshua. A suggestion for a new release of DT:F:ISO.
If implemented, DT:F:ISO should also be able to ->format_datetime on DateTime::Incomplete objects so long as the available data matches one of the allowable ISO formats.
It won't work at the moment, but it could work.
As Dave says, there are only a couple of formats that allow incompletes (AFAIK, this is the only one we have right now, although Strptime allows you to create an incomplete format). Because of this, the core DateTime is not the place for it. Only formats that support incomplete dates should work with DT:I objects.
Cheers! Rick Measham
-- -------------------------------------------------------- There are 10 kinds of people: those that understand binary, and those that don't. -------------------------------------------------------- The day Microsoft makes something that doesn't suck is the day they start selling vacuum cleaners -------------------------------------------------------- "Write a wise proverb and your name will live forever." -- Anonymous --------------------------------------------------------
