Subject: | 0000-00-00 00:00:00 fails in scalar context but strptime parses? |
I'm not sure what I'm expecting the output to be, but when using
str2time or strptime just as a simple check for 'properly formatted'
both fail. It seems that str2time should at least return something like
-1 in a case like this.
#!/usr/bin/perl;
use strict;
use warnings;
use Test::Most qw{no_plan};
use Date::Parse;
my $z = '0000-00-00 00:00:00';
ok(str2time($z)); # FAILS
is(str2time($z),undef);
ok(strptime($z)); # FAILS
is(strptime($z),undef);
eq_or_diff (
[strptime($z)],
[qw{00 00 00 00 -1 0000}, undef]
)
--
benh~