my ( $mday, $mon, $year ) = (localtime())[3..5]; my $date = sprintf("%04d-%02d-%02d", $year+1900, $mon+1, $mday);