D
Daniel
I'm getting unexpected results from localtime. The runtime of my
programm is about 4 seconds but I'm expecting more so I'm having it
report how long it took. I reduced the code to the minimum and still
get the unexpected result. Perhaps you can help. Here is the code:
use strict;
use warnings;
my $now=time();
print scalar localtime($now), "\n";
sleep 4;
print scalar localtime(time()-$now), "\n";
That should result in printing todays date and time and then 4 seconds
after midnight january 1st 1970. but the printout gives one hour more.
Wed Nov 16 17:32:49 2005
Thu Jan 1 01:00:04 1970
It's a Windows XP Pro machine with perl 5.8.7 from ActiveState.
I'm in Germany so I've got GMT+1, but that shouldn't show.
So whats going on here?
Daniel Cutter
print chr--$g+ord for'KWVX%GUW]RP^-^Tb]2[UXa\j#'=~m$.$g;
programm is about 4 seconds but I'm expecting more so I'm having it
report how long it took. I reduced the code to the minimum and still
get the unexpected result. Perhaps you can help. Here is the code:
use strict;
use warnings;
my $now=time();
print scalar localtime($now), "\n";
sleep 4;
print scalar localtime(time()-$now), "\n";
That should result in printing todays date and time and then 4 seconds
after midnight january 1st 1970. but the printout gives one hour more.
Wed Nov 16 17:32:49 2005
Thu Jan 1 01:00:04 1970
It's a Windows XP Pro machine with perl 5.8.7 from ActiveState.
I'm in Germany so I've got GMT+1, but that shouldn't show.
So whats going on here?
Daniel Cutter
print chr--$g+ord for'KWVX%GUW]RP^-^Tb]2[UXa\j#'=~m$.$g;