注意:localtime获取的年份是相对于1900的偏移,需要加上1900,而localtime获取的month范围是0-11,需要加1。
#!/usr/bin/perl
my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst) = localtime();
$year += 1900;
$mon++;
my $date = "$year-$mon-$day";
print $date, "n";
注意:localtime获取的年份是相对于1900的偏移,需要加上1900,而localtime获取的month范围是0-11,需要加1。
#!/usr/bin/perl
my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst) = localtime();
$year += 1900;
$mon++;
my $date = "$year-$mon-$day";
print $date, "n";

2023-03-06
0万阅读

2023-03-01
0万阅读

2023-02-23
3万阅读

2023-02-23
5万阅读

2023-02-23
7万阅读

2023-02-22
6万阅读

2023-02-17
5万阅读

2023-01-18
2万阅读

2022-12-23
4万阅读

2022-12-22
4万阅读

2023-03-06
0万阅读

2023-03-01
0万阅读

2023-02-23
3万阅读

2023-02-23
5万阅读

2023-02-23
7万阅读

2023-02-22
6万阅读

2023-02-17
5万阅读

2023-01-18
2万阅读

2022-12-23
4万阅读

2022-12-22
4万阅读