yeah, strftime/strptime isn't identically portable ... I've always had issue with %Z on win32 ... but DateTime's strftime/strptime is portable
#!/usr/bin/perl --
use strict;
use warnings;
use Time::Piece;
my $dt = 'Fri, 20 Sep 2024 01:14:03 UTC';
my $format = '%a, %d %b %Y %T %Z';
#~ print Time::Piece->strptime( $dt, $format );
my @date = split ' ', $dt;
my @format = split ' ', $format;
for my $ix ( 0 .. $#date ){
print "$ix ## ", "$date[$ix] == $format[$ix]\n";
print "$ix ## ", eval {
Time::Piece->strptime( $date[$ix], $format[$ix] );
} || $@, "\n";
}
exit;
__END__
0 ## Fri, == %a,
0 ## Thu Jan 1 00:00:00 1970
1 ## 20 == %d
1 ## Tue Jan 20 00:00:00 1970
2 ## Sep == %b
2 ## Tue Sep 1 00:00:00 1970
3 ## 2024 == %Y
3 ## Mon Jan 1 00:00:00 2024
4 ## 01:14:03 == %T
4 ## Thu Jan 1 01:14:03 1970
5 ## UTC == %Z
5 ## Error parsing time at C:/citrusperl/site/lib/Time/Piece.pm
+line 469.