localtime() acting like gmtime() in Perl

Charles Plager cplager+cygwin@physics.ucla.edu
Sun Feb 29 01:02:00 GMT 2004


Hello,
	localtime() seems to be returning  GMT instead of the local time.  I've 
tested the same script on three different machines.  (Unfortunately, on 
linux and sgi, they are using perl 5.6.1 whereas on cygwin, I'm using 
5.8.2, but I don't *think* it's a perl bug).  If I just use 'date', I 
get the correct local time.  Any ideas?

	TIA,
	  Charles

---- script -----
#!/usr/bin/perl

my $localt = localtime();
my $gmt = gmtime();
system "date";
print "local $localt\ngmt $gmt\n";

----- output on cygwin ----
cplager@pointyjr> testDT.pl
Sat Feb 28 18:31:18 CST 2004
local Sun Feb 29 00:31:17 2004
gmt Sun Feb 29 00:31:17 2004

------ output on linux -----
cplager@b0dap30> test.pl
Sat Feb 28 18:27:51 CST 2004
local Sat Feb 28 18:27:51 2004
gmt Sun Feb 29 00:27:51 2004


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20040229/63a0bdca/attachment.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list