in reply to Re^3: Timezone Conversion
in thread Timezone Conversion

What OS, what Perl version? It works for me (both Linux and cygwin, 5.18 / 5.22). Also, check the versions of the used modules.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^5: Timezone Conversion
by mhooper (Novice) on Oct 29, 2015 at 15:05 UTC

    CentOS release 6.6 (Final) Module Version CPAN 1.9800 Log::Log4perl 1.38 Perl 5.10.1 PerlIO::via::MD5 0.07 Term::ReadKey 2.30 Time::Format 1.11 Time::ParseDate 2013.1113 Time::Piece 1.31

      Adding $ENV{TZ} = 'Etc/UTC'; at beginning of code seems to correct but noting that is resetting the timezone for the whole process not just the the one conversion. All log times etc post that change are in UTC not EDT as required.

      .
        Adding $ENV{TZ} = 'Etc/UTC'; at beginning of code seems to correct …
        What about not adding, but changing the line
        local $ENV{TZ} = 'UTC';
        to
        local $ENV{TZ} = 'Etc/UTC';
        instead?