my (@time) = (localtime)[4,3,5]; my ($date) = sprintf ("%d/%02d/%02d", $time[0]+1900, $time[1]+1, $time[2]); # Or if you don't care about formatting: my ($date) = join ('/', $time[0]+1900, $time[1]+1, $time[2]); # Or if you want to combine with your print, which would # avoid having to declare $date: printf GRAVE ("# consigned to the graveyard on %d/%d/%d\n", $date[0]+1900, $date[1]+1, $date[2]);