$^O eq "MSWin32" || $^O eq "dos" || $^O eq "interix";
tzset();
my @tzname = tzname();
- like($tzname[0], qr/[GMT|UTC]/i, "tzset() to GMT/UTC");
+ like($tzname[0], qr/(GMT|UTC)/i, "tzset() to GMT/UTC");
SKIP: {
skip "Mac OS X/Darwin doesn't handle this", 1 if $^O =~ /darwin/i;
- like($tzname[1], qr/[GMT|UTC]/i, "The whole year?");
+ like($tzname[1], qr/(GMT|UTC)/i, "The whole year?");
}
}
# Careful! strftime() is locale sensative. Let's take care of that
my $orig_loc = setlocale(LC_TIME, "C") || die "Cannot setlocale() to C: $!";
-if ($^O eq "MSWin32") {
- is(ctime(0), strftime("%a %b %#d %H:%M:%S %Y\n", localtime(0)),
+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()");
-} else {
- is(ctime(0), strftime("%a %b %e %H:%M:%S %Y\n", localtime(0)),
- "get ctime() equal to strftime()");
-}
setlocale(LC_TIME, $orig_loc) || die "Cannot setlocale() back to orig: $!";
# clock() seems to have different definitions of what it does between POSIX