为你:
use POSIX qw/strftime/; print strftime("%Y-%m-%d",localtime),"\n";
对于电脑:
my @t = localtime; $t[5] += 1900; $t[4]++; printf "%04d-%02d-%02d",@t[5,4,3];