my ($day, $month, $year) = (split (/\s|:/, localtime))[2,3,6]; $year = substr $year, 2,2; my $date = $year . $month . $day;