在我执行以下守则时,有正确的日期:
10/05/2008
10/05/2009
当我使用<条码>而不是<条码>时,请参看条码>。 我收到下列文件:
10/05/200910/05/20081
1
关于为什么<代码>印本/编码>的任何想法 打印<代码>1?
#!/usr/bin/perl
use strict; use warnings;
my ($from_date, $to_date) = to_from_dates();
print "$from_date
";
print "$to_date
";
sub to_from_dates {
my ($day, $month, $year) = (localtime)[3,4,5];
my $to_date = sprintf "%02d/%02d/%04d", $month+1, $day, $year+1900;
my $from_date = sprintf "%02d/%02d/%04d", $month+1, $day, $year+1899;
return ($from_date, $to_date);
}