Subject: | Order of dates processed changes results |
An interesting case is present when you process a rather old date, such
as 1918/2/18 and then process another date, the results will be
different for both dates if you reversed the order. In the provided
perl script, if you comment out one for statement and activate the
other you will find the two dates provide different results. The date
that is wrong is the one that processes older first.
I've also included a output of my testing to show the examples.
perl v5.8.0
SunOS 5.10
Subject: | julian02.pl |
#!/idn/app/bin/perl
use strict;
use warnings;
use English qw( -no_match_vars );
use Time::ParseDate;
foreach my $j_dt ('1918/2/18','2009/7/7') {
#foreach my $j_dt ('2009/7/7','1918/2/18') {
my $seconds = parsedate($j_dt);
print "$j_dt -> $seconds\n";
}
__END__
Subject: | output.txt |
cfroon@maverick Perl > julian02.pl
2009/7/7 -> 1246950000
1918/2/18 -> -1636822800
cfroon@maverick Perl > julian02.pl
1918/2/18 -> -1636826400
2009/7/7 -> 1246946400