use Time::Local; my ($sec, $min, $hour, $day, $month, $year) = (49, 29, 20, 31, 1-1, 2019-1900); my $unix_timestamp = timelocal($sec, $min, $hour, $day, $month, $year); print "Unix Timestamp: $unix_timestamp\n";
timelocal()
time()
localtime()
localtime(time())
gmtime()
gmtime(time())
strftime()
strftime("%Y-%m-%d %H:%M:%S", localtime(time()))
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")