AsianFlu has asked for the wisdom of the Perl Monks concerning the following question:
This doesn't work anymore on perl 5.8.0 on redhat 9. Although perl will start and localtime() obeys the current setting of TZ, using ENV{TZ} to change it, does nothing! so now I have to use this terrible thing:$ENV{TZ}="US/Eastern"; # use locatime(time) to get the time $ENV{TZ}="Other/Zone"; # use localtime(time) to get the time # subtract the difference
Which is highly upsetting! I do not want to load the huge Date::Time module in just do so such a simple thing. (current seconds difference between two time zones). What shall I do? I've tried POSIX strftime as well, and that doesnt help anymore either. Why was this (apparently) changed? or is it a bug?my $rfc_offset = `TZ=US/Eastern; date +%s`; my $rfc_offset2= `TZ=Other/Zone; date +%s`; # code to work out difference in seconds.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Offset between two time zones.
by sgifford (Prior) on Oct 24, 2003 at 23:15 UTC | |
|
Re: Offset between two time zones.
by tachyon (Chancellor) on Oct 25, 2003 at 10:53 UTC |