Updating Time::Piece to 1.29 is not the problem. I get the same error under 1.27.

$ perl -MTime::Piece -E 'say $Time::Piece::VERSION' 1.27 $ perl -MPOSIX=strftime -MTime::Piece -E ' say strftime q{%FT%T}, loca +ltime; Time::Piece->strptime( strftime(q{%FT%T}, localtime), q{%FT%T} +);' 2015-04-29T04:18:23 Error parsing time at /Users/ken/perl5/perlbrew/perls/perl-5.20.2t/lib +/5.20.2/darwin-thread-multi-2level/Time/Piece.pm line 469.

The error message includes a pathname to the file and a line number. Had you viewed that file and gone to line 469, you would have seen that line is in sub strptime and, just a few lines above, you see sub strftime (sound familiar?).

Looking at the Time::Piece documentation, you'll see that Time::Piece::strftime is the "same as POSIX::strftime (without the overhead of the full POSIX extension)".

To fix, the easiest would be to remove the POSIX references. If, for some reason, that's not possible (I've no idea what your real code looks like), you'll need to be specific about which strftime you mean, i.e. POSIX::strftime or Time::Piece::strftime.

-- Ken


In reply to Re: Error parsing using Time::Piece by kcott
in thread Error parsing using Time::Piece by Anonymous Monk

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.