use POSIX 'strftime'; my $date = strftime '%Y/%m/%d %H:%M:%S', localtime $epoch;