In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/036055ae9ae83cd5b00514419663540cb13fc21a?hp=9b33fb8e6c642ded0db0a0bb8945dd083127b56f>
- Log ----------------------------------------------------------------- commit 036055ae9ae83cd5b00514419663540cb13fc21a Author: Ian Goodacre <[email protected]> Date: Wed Mar 25 08:39:11 2009 -0500 [perl #63914] Time::Piece reports timezone incorrectly ----------------------------------------------------------------------- Summary of changes: ext/Time-Piece/Piece.xs | 2 +- ext/Time-Piece/t/02core.t | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ext/Time-Piece/Piece.xs b/ext/Time-Piece/Piece.xs index e20b6d4..e65f20c 100644 --- a/ext/Time-Piece/Piece.xs +++ b/ext/Time-Piece/Piece.xs @@ -23,7 +23,7 @@ extern "C" { * support is added and NETaa14816 is considered in full. * It does not address tzname aspects of NETaa14816. */ -#if !defined(HAS_GNULIBC) +#if defined(HAS_GNULIBC) # ifndef STRUCT_TM_HASZONE # define STRUCT_TM_HASZONE # else diff --git a/ext/Time-Piece/t/02core.t b/ext/Time-Piece/t/02core.t index d020558..fb43038 100644 --- a/ext/Time-Piece/t/02core.t +++ b/ext/Time-Piece/t/02core.t @@ -1,4 +1,4 @@ -use Test::More tests => 93; +use Test::More tests => 95; my $is_win32 = ($^O =~ /Win32/); my $is_qnx = ($^O eq 'qnx'); @@ -47,6 +47,13 @@ cmp_ok($t->datetime, 'eq','2000-02-29T12:34:56'); cmp_ok($t->daylight_savings, '==', 0); # ->tzoffset? +{ + local $ENV{TZ} = "EST"; + my $lt = localtime; + cmp_ok(scalar($lt->tzoffset), 'eq', '-18000'); + cmp_ok($lt->strftime("%z"), 'eq', '-0500'); +} + cmp_ok(($t->julian_day / 2451604.0243 ) - 1, '<', 0.001); cmp_ok(($t->mjd / 51603.52426) - 1, '<', 0.001); cmp_ok($t->week, '==', 9); -- Perl5 Master Repository
