This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use gmtime() instead of localtime(), as timezones hinder testing strtime().
authorNicholas Clark <nick@ccl4.org>
Sun, 18 Oct 2009 16:41:19 +0000 (17:41 +0100)
committerNicholas Clark <nick@ccl4.org>
Sun, 18 Oct 2009 16:41:19 +0000 (17:41 +0100)
(Specifically negative timezones on operating systems without tzset(). Coming
from Washington State, you would have thought that they would have thought of
this.)

ext/POSIX/t/time.t

index c349646..01ce87f 100644 (file)
@@ -39,7 +39,7 @@ my $orig_loc = setlocale(LC_TIME, "C") || die "Cannot setlocale() to C:  $!";
 my $jan_16 = 15 * 86400;
 is(ctime($jan_16), strftime("%a %b %d %H:%M:%S %Y\n", localtime($jan_16)),
         "get ctime() equal to strftime()");
-is(strftime("%Y\x{5e74}%m\x{6708}%d\x{65e5}", localtime($jan_16)),
+is(strftime("%Y\x{5e74}%m\x{6708}%d\x{65e5}", gmtime($jan_16)),
    "1970\x{5e74}01\x{6708}16\x{65e5}",
    "strftime() can handle unicode chars in the format string");