in reply to Re: Mod_Perl multiple timezones
in thread Mod_Perl multiple timezones
The following script will work beautifully when run from the command line.
When called as a CGI under mod_perl_2 (1.99.08) it will output identical dates for all the different time zones!
Is this a known problem???
#! /opt/perl/bin/perl -w
use strict;
use POSIX;
print
"Content-type: text/plain\n\n",
"Time zone stuff\n",
"***************\n",
"\n";
my $now = time;
$ENV{TZ} = "Europe/London"; POSIX::tzset();
print "Time in Europe/London is " . localtime($now) . " +OK\n";
$ENV{TZ} = "Europe/Paris"; POSIX::tzset();
print "Time in Europe/Paris is " . localtime($now) . " +OK\n";
$ENV{TZ} = "America/Chicago"; POSIX::tzset();
print "Time in America/Chicago is " . localtime($now) . " +OK\n";
exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Mod_Perl multiple timezones
by Chmrr (Vicar) on Jul 23, 2003 at 23:18 UTC | |
by dtr (Scribe) on Jul 24, 2003 at 10:00 UTC | |
by Anonymous Monk on Aug 05, 2003 at 02:21 UTC |