From: Nicholas Clark Date: Sun, 18 Oct 2009 16:41:19 +0000 (+0100) Subject: Use gmtime() instead of localtime(), as timezones hinder testing strtime(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=28c3d5f4a254cce07b783305aa5f3a842a9aecbc;p=p5sagit%2Fp5-mst-13.2.git Use gmtime() instead of localtime(), as timezones hinder testing strtime(). (Specifically negative timezones on operating systems without tzset(). Coming from Washington State, you would have thought that they would have thought of this.) --- diff --git a/ext/POSIX/t/time.t b/ext/POSIX/t/time.t index c349646..01ce87f 100644 --- a/ext/POSIX/t/time.t +++ b/ext/POSIX/t/time.t @@ -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");