in reply to DateTime not observing $ENV{TZ} by default?

Also, to dynamically swap timezones, use tzset from POSIX. (I did not know about this until last week, and it helped me solve a five-year-old bug. Doesn't work on Windows, though.)
$ENV{TZ} = "CEST"; tzset;

Replies are listed 'Best First'.
Re^2: DateTime not observing $ENV{TZ} by default?
by Anonymous Monk on Jul 21, 2011 at 02:40 UTC

    Thanks, DateTime ignores it though.

    So is explicit argument to constructor the only way to do it? Doesn't seem very Perlish to me :-)

      So is explicit argument to constructor the only way to do it?

      Yes, its the only way; you could create alternate constructor, or propose a patch for one

      Doesn't seem very Perlish to me :-)

      Why? time doesn't consult ENV{TZ} and neither does gmtime -- The module is called DateTime not, localtime :)