且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Perl 中的今天日期,格式为 MM/DD/YYYY

更新时间:2023-01-29 10:47:32

只用一个POSIX

You can do it fast, only using one POSIX function. If you have bunch of tasks with dates, see the module DateTime.

use POSIX qw(strftime);

my $date = strftime "%m/%d/%Y", localtime;
print $date;