"Seconds since the epoch" is the optional argument to "localtime". So
my $date = localtime $epoch provides the basic data string according to the value of $epoch.
Formatting dates can be done is many different ways and you'll most certainly see some in other replies or the documentation.