my $unix_timestamp = 1699336923; my ($sec, $min, $hour, $day, $month, $year) = localtime($unix_timestamp); # Adjust year and month to human-readable format $year += 1900; $month += 1; print "Converted Date: $year-$month-$day $hour:$min:$sec\n";
1699336923
localtime()
2023-11-07 06:02:03
time()
localtime(time())
gmtime()
gmtime(time())
strftime()
strftime("%Y-%m-%d %H:%M:%S", localtime(time()))
timelocal()
timelocal(0, 34, 12, 28, 7, 2024)
timegm()
timegm(0, 34, 12, 28, 7, 2024)
DateTime->now()
DateTime->from_epoch()
DateTime->from_epoch(epoch => 1693227296)
DateTime->ymd()
$dt->ymd()
DateTime->strftime()
$dt->strftime("%Y-%m-%d %H:%M:%S")