use Date::Calc qw(:all); ($year,$month,$day) = ($transfer_start_date =~ /(\d{4})(\d\d)(\d\d)/); ($hour, $min, $sec) = ($transfer_start_time =~ /(\d{4})(\d\d)(\d\d)/); print sprintf "%.3s %.3s %d %02d:%02d:%02d %4d", Day_of_Week_to_Text(Day_of_Week($year, $month, $day)), Month_to_Text($month), $day, $hour, $min, $sec, $year; # or, simpler and pretty close print join ' ', Date_to_Text($year, $month, $day), sprintf "%02d%02d%02d", $hour, $min, $sec;