POSIX-strftime-Compiler
view release on metacpan or search on metacpan
t/02_timezone.pl view on Meta::CPAN
#!/usr/bin/perl
use strict;
use warnings;
BEGIN {
if ($ENV{TEST_TZ}) {
$ENV{TZ} = delete $ENV{TEST_TZ};
# Windows can't change timezone inside Perl script
if ($^O eq 'MSWin32') {
exec { $^X } map "\"$_\"", $^X, (map "-I$_", @INC), $0, @ARGV;
}
};
}
use Time::Local;
use POSIX::strftime::Compiler;
my $fmt = shift @ARGV || '%z';
my @t = @ARGV ? localtime timelocal(@ARGV) : localtime;
print POSIX::strftime::Compiler::strftime($fmt,@t);
( run in 1.291 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )