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.

In reply to Re: Time::Piece->strptime formatting throws: Error parsing time . . . (split %Z) by Anonymous Monk
in thread Time::Piece->strptime formatting throws: Error parsing time . . . by hesco

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.