Perl 日期时间函数(date time)

use Time::HiRes qw(time);
use POSIX qw(strftime);

my $t = time;
my $date = strftime "%Y%m%d %H:%M:%S", localtime $t;
$date .= sprintf ".%03d", ($t-int($t))*1000; # without rounding

print $date, "\n";

# cat > ttt.pl
# perl ttt.pl

posted @ 2014-07-16 15:02  emanlee  阅读(2610)  评论(0编辑  收藏  举报