J
J Moreno
As I read the documentation, the day of the year in both should be the
same, but when I run the script below, they differ by a day (I get the
day before the today's day as returned by localtime).
Is this a problem with the documentation, my reading of the
documentation, or a bug (i.e. do I have to check to see if the behavior
changes based upon version or something)?
###
use warnings;
use strict;
use Time::Local 'timelocal_nocheck';
$\ = "\n";
my $b;
my $day_of_year;
($b,$b,$b,$b,$b,$b,$b,$day_of_year) = localtime;
print "From localtime: " . $day_of_year;
($b,$b,$b,$b,$b,$b,$b,$day_of_year) = localtime timelocal_nocheck
(0,0,0,$day_of_year, 0, 0);
print "From localtime via timelocal_nocheck: " . $day_of_year;
###
Outputs:
From localtime: 66
From localtime via timelocal_nocheck 65
same, but when I run the script below, they differ by a day (I get the
day before the today's day as returned by localtime).
Is this a problem with the documentation, my reading of the
documentation, or a bug (i.e. do I have to check to see if the behavior
changes based upon version or something)?
###
use warnings;
use strict;
use Time::Local 'timelocal_nocheck';
$\ = "\n";
my $b;
my $day_of_year;
($b,$b,$b,$b,$b,$b,$b,$day_of_year) = localtime;
print "From localtime: " . $day_of_year;
($b,$b,$b,$b,$b,$b,$b,$day_of_year) = localtime timelocal_nocheck
(0,0,0,$day_of_year, 0, 0);
print "From localtime via timelocal_nocheck: " . $day_of_year;
###
Outputs:
From localtime: 66
From localtime via timelocal_nocheck 65