use POSIX qw( strftime ); my $date = strftime "%m-%d-%y", localtime; print "$date\n";