use strict; use warnings; use Time::Piece; use feature 'say'; my $fmt = '%d %b %Y %T %Z'; say localtime->strftime; say localtime->strftime($fmt); my $str = '03 Sep 2022 16:10:17 GMT Daylight Time'; my $strtime = Time::Piece->strptime($str, $fmt); say localtime->epoch; say $strtime->epoch;