sub unix_to_date { my ($date) = $_[0]; # reads in variable passed to subroutine my (@months) = qw!Jan Feb Mar Apr May Jun Jul Aug sep Oct Nov Dec!; #creates array of month names @time = (localtime($date))[3,4,5]; #creates array of date from unix time $time[2] += 1900; # converts year to proper format return "$time[0]-$months[$time[1]]-$time[2]"; } #### $date_from_unix = &unix_to_date(epochtime);