Craig A. Berry [Fri, 27 Mar 2009 14:30:01 +0000 (09:30 -0500)]
This is a follow-up to
036055ae9ae83cd5b00514419663540cb13fc21a. Setting
TZ in the environment may or may not have any effect without calling tzset()
afterwards, and the %z format specifier for strftime() is not in the
standard (and was causing smoke failures in many places).
# ->tzoffset?
{
local $ENV{TZ} = "EST";
+ Time::Piece::_tzset(); # register the environment change
my $lt = localtime;
cmp_ok(scalar($lt->tzoffset), 'eq', '-18000');
- cmp_ok($lt->strftime("%z"), 'eq', '-0500');
+ cmp_ok($lt->strftime("%Z"), 'eq', 'EST');
}
cmp_ok(($t->julian_day / 2451604.0243 ) - 1, '<', 0.001);