Subject: | calling strftime changes the behavior of localtime |
machine 1: Date::Simple 3.01 with Perl 5.8.7 on Debian 3.1 sarge
machine 2: Date::Simple 3.02 with Perl 5.8.6 on RedHat Fedora Core 4
The behavior of localtime() changes after calling strftime().
In the attached test program, the first and second print are supposed to print out the same result. But I got the following result on both machines: (my timezone is GMT+8)
[foo@localhost ~]# perl /tmp/localtime_test.pl
Mon Nov 7 00:00:00 2005
Sun Nov 6 16:00:00 2005
#!/usr/bin/perl -w
use strict;
use Date::Simple;
my $time = 1131292800;
print scalar localtime $time, "\n";
my $foo = Date::Simple::today->strftime('%Y');
print scalar localtime $time, "\n";