"Mothra" <> wrote in message news:<3f76f5ff$>...
> [snipped]
> Please take a look at the DateTime project.
> http://datetime.perl.org/
>
> > Thank you in advance for any help,
> >
> > Jon.
>
> Hope this helps
>
> Mothra
Thanks for that, DateTime seems just what I need. However, I noticed
a possible reason why stuff I was doing was not working. When I set
the TZ to the timezone, any other changes I make do not take effect.
$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";
So this should return 2 times, within an hour of each other, however
it returns the same time.
1:57
1:57
So I done some more digging, and run strace on the script, it turns
out it only opens the first zoneinfo file. I tried the same script on
another server, and it worked correctly. The one it failed on is
running Perl v5.8.0, on Linux kernel 2.4.20.
The working servers run a older version of Perl and of the kernel. I
did read about localtime caching the timezone, but didn't think that
happen now days.
Jon.