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; #### Sat, 03 Sep 2022 16:10:35 GMT Daylight Time 03 Sep 2022 16:10:35 GMT Daylight Time Garbage at end of string in strptime: Daylight Time at C:/Strawberry/perl/lib/Time/Piece.pm line 598. Perhaps a format flag did not match the actual input? at C:/Strawberry/perl/lib/Time/Piece.pm line 598. 1662217835 1662221417