use POSIX qw( strftime ); my $datestring = strftime '%m-%d-%Y %H:%M', localtime; print $datestring, $/; # prints "01-14-2003 00:06" atm