From 375966b6da80a97438dba9f449eab3084ec1cd7a Mon Sep 17 00:00:00 2001 From: Graham Barr Date: Thu, 24 Sep 2009 09:09:22 -0500 Subject: [PATCH] RT#49963 Skip pre 1970 date tests on Win32 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." --- t/date.t | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/t/date.t b/t/date.t index 0105b2b..a2649ae 100644 --- a/t/date.t +++ b/t/date.t @@ -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 @@ -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)