Skip to content

Commit

Permalink
RT#49963 Skip pre 1970 date tests on Win32
Browse files Browse the repository at this point in the history
It seems that the problem is with negative dates/timestamps (before
01/01/1970) that are not well supported on Win32.

It might be somehow related to a note at:
http://search.cpan.org/~dapm/perl-5.10.1/pod/perlport.pod#Time_and_Date

saying:
"On Windows (at least), you shouldn't pass a negative value to gmtime or
localtime."
  • Loading branch information
gbarr committed Sep 24, 2009
1 parent f880993 commit 375966b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions t/date.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use Date::Format qw(time2str);

$data = qq!1995-01-24
1995-01-24T09:08:17.1823213
1935-01-24T09:08:17
Fri Dec 17 00:00:00 1901 GMT
- 1935-01-24T09:08:17
- Fri Dec 17 00:00:00 1901 GMT
Tue Jan 16 23:59:59 2038 GMT
2001-02-02 00:00:00 GMT
2035-02-02 00:00:00 GMT
16 Jun 33 07:29:35 CST
- 16 Jun 33 07:29:35 CST
2002-02-26-10:37:21.141 GMT
Wed, 16 Jun 94 07:29:35 CST
Wed, 16 Nov 94 07:29:35 CST
Expand Down Expand Up @@ -162,6 +162,13 @@ $loop = 2;

foreach (@data)
{
my $pre_1970 = s/^-\s*//;

if ($pre_1970 and $^O eq "MSWin32") {
print "ok ",$loop++," # skip\n";
next;
}

$time = str2time($_);

if(defined $time)
Expand Down

0 comments on commit 375966b

Please sign in to comment.