J
Jon
While doing some time/date functions I had to change the timezone used
(by changing the ENV{TZ}) twice in one script. However, it seems the
kernel cached the last zone and failed to open or change to the new
one. I confirmed this using strace, as you could see it only opened
the one file. The code I used is as follows.
$ENV{TZ} = ':/usr/share/zoneinfo/Europe/London';
$time = time();
($sec,$min,$hour,$day,$mon,$this_year,$wday,$yday,$isdst) =
localtime($time);
print "$hour:$min\n";
$ENV{TZ} = ':/usr/share/zoneinfo/Europe/Paris';
($sec,$min,$hour,$day,$mon,$this_year,$wday,$yday,$isdst) =
localtime($time);
print "$hour:$min\n";
Is the code I used. The times should be out by an hour (Paris is one
hour ahead of London), however for me they both show the same time,
which is within the London (GMT+1) timezone. The results were
different on another server.
Linux 2.4.20 complied from source, Perl 5.8.0 (RedHat RPM) - failed.
Linux 2.4.7 RedHat supplied, Perl 5.6.0 (RedHat RPM) - worked.
I should really repeat the tests with the same version of Perl on both
kernels, this time I will build Perl myself, I will try that later
today, but I wonder if anyone else can confirm this issue or maybe
point me in the direction of the problem.
Jon.
(by changing the ENV{TZ}) twice in one script. However, it seems the
kernel cached the last zone and failed to open or change to the new
one. I confirmed this using strace, as you could see it only opened
the one file. The code I used is as follows.
$ENV{TZ} = ':/usr/share/zoneinfo/Europe/London';
$time = time();
($sec,$min,$hour,$day,$mon,$this_year,$wday,$yday,$isdst) =
localtime($time);
print "$hour:$min\n";
$ENV{TZ} = ':/usr/share/zoneinfo/Europe/Paris';
($sec,$min,$hour,$day,$mon,$this_year,$wday,$yday,$isdst) =
localtime($time);
print "$hour:$min\n";
Is the code I used. The times should be out by an hour (Paris is one
hour ahead of London), however for me they both show the same time,
which is within the London (GMT+1) timezone. The results were
different on another server.
Linux 2.4.20 complied from source, Perl 5.8.0 (RedHat RPM) - failed.
Linux 2.4.7 RedHat supplied, Perl 5.6.0 (RedHat RPM) - worked.
I should really repeat the tests with the same version of Perl on both
kernels, this time I will build Perl myself, I will try that later
today, but I wonder if anyone else can confirm this issue or maybe
point me in the direction of the problem.
Jon.