2010/11/27 Philip Kime via RT <bug-datet...@rt.cpan.org>:
>
> It seems that it's impossible to instantiate an object with missing 
> information even when it's
> allowed by the format. Using DateTime::Format::ISO8601 I can instantiate
>
> ->new('2003')
>
> which is allowed by ISO8601 but then DateTime applies a default month and
>
> ->month
>
> gives "01"
>
> so it's impossible to distinguish whether the date passed was "2003" or  
> "2003-01-01", for
> example. I would have expected ->month to return "undef" for the former but 
> it defaults to "01"
> and I can't find a way to prevent this. Seems the same also in every other 
> date module I have
> tried.

Have you looked at DateTime::Incomplete?

http://search.cpan.org/dist/DateTime-Incomplete/lib/DateTime/Incomplete.pm

Flávio S. Glock

Reply via email to