Jonathan,

Things work allright if I remove the TZ variable alltogether.

But this is not really a solution. I continuously switch between unix, nt
and win2k and I am using RCS as revision control system in each of these
environments. RCS does not work if the timezone is not set. And according to
the books, Perl should work properly with timezones, which it does on Unix.

I think that this really is a bug in the ActiveState implementation.

I hope that this is the proper communicate to signal such a problem.

Guido.

----- Original Message -----
From: "Jonathan Crowther" <[EMAIL PROTECTED]>
To: "'Guido Van Hoecke'" <[EMAIL PROTECTED]>; "activeperl"
<[EMAIL PROTECTED]>
Sent: Saturday, December 02, 2000 00:31
Subject: RE: problem with localtime and gmtime


> I haven't had this problem, but I suggest you check if the Daylight
Savings
> is turned on or off in the Control Panel Date/Time
>
> Also use the following to look at the 'dst':
>   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
>   print $isdst;
>
> Note, when I execute your command, the TZ doesn't print (it's undefined),
> and I'm in GMT+8.
> My times print OK.
>
> Perhaps you should try setting TZ to GMT and see if that works, or delete
> the TZ environment variable altogether.
>
> Cheers,
> Jonathan
>
> -----Original Message-----
> From: Guido Van Hoecke [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 01, 2000 3:11 PM
> To: activeperl
> Subject: problem with localtime and gmtime
>
>
> There seems to be a problem with localtime and gmtime in
> ActiveState's perl, v5.6.0 built for MSWin32-x86-multi-thread.
>
> My timezone is MET which is the same as GMT+1,
> so localtime should be one hour later as gmtime.
> But it's not :
>
> print
>   'timezone = ' . $ENV{TZ} . '\n' .
>   'localtime = ' . localtime . '\n' .
>   'gmtime = ' . gmtime . '\n';
>
> prints
>
> timezone = MET
> localtime = Fri Dec  1 17:38:15 2000
> gmtime = Fri Dec  1 17:38:15 2000
>
> where it is really 18:38 local time.
>
> On the other hand if I display the time of
> a recently created file with both localtime and gmtime,
> it shows the correct time of the file,
> but gmtime also specifies the localtime :
>
> `dir loctim.pl > dir.txt`;
> ($seconds, $minutes, $hours, ) = (localtime($mtime))[0..2];
> printf "File dir.txt was created at localtime %02d:%02d:%02d\n",
>   $hours, $minutes, $seconds;
> ($seconds, $minutes, $hours, ) = (gmtime($mtime))[0..2];
> printf "File dir.txt was created at gmtime %02d:%02d:%02d\n",
>   $hours, $minutes, $seconds;
>
> prints :
> File dir.txt was created at localtime 18:38:15
> File dir.txt was created at gmtime 18:38:15
>
> Does anyone experience the same problems,
> or is there a workaround or fix for this problem.
>
> Any suggestions are most welcome,
>
> Guido.
>
>
>
> _______________________________________________
> ActivePerl mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activeperl
>

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to