Skip Menu |

This queue is for tickets about the TimeDate CPAN distribution.

Report information
The Basics
Id: 66358
Status: rejected
Priority: 0/
Queue: TimeDate

Owner: Nobody in particular
Requestors: MGI [...]

Bug Information
Severity: Wishlist
Broken in: 1.20
Fixed in: (no value)

Download (untitled) / with headers
text/plain 783b
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/ line 208, <GEN1> line 893. at /usr/lib/perl5/site_perl/5.10/Date/ 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
Download (untitled) / with headers
text/plain 253b
this is intentional. strptime returns undef for fields it does not know the value for. and strftime needs to know all fields. If you want to use incomplete dates, you need to fill in those fields any guess TImeDate would do would be wrong for someone

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to