With an date specified incompletely, strptime sets some fields to undef,
which Date::Format::strftime doesn't accepts as input.
Setting the fields instead to 0 would make the two functions more
consistent.
Example under the debugger):
DB<10> p $ts
1-Jan-2009
DB<11> @bits = strptime($ts)
DB<12> x @bits
0 undef
1 undef
2 undef
3 1
4 0
5 109
6 undef
DB<13> p strftime(q(%Y-%m-%dT%H:%M:%S%z), @bits)
Use of uninitialized value in sprintf at
/usr/lib/perl5/site_perl/5.10/Date/Format.pm line 208, <GEN1> line 893.
at /usr/lib/perl5/site_perl/5.10/Date/Format.pm line 208
...
2009-01-01T00:00:00+0000
DB<17> for(@bits){$_=0 unless $_}
DB<18> x @bits
0 0
1 0
2 0
3 1
4 0
5 109
6 0
DB<19> p strftime(q(%Y-%m-%dT%H:%M:%S%z), @bits)
2009-01-01T00:00:00+0000