RFC 3339 is a subset of ISO 8601 time formats for use in Internet communications.
An RFC 3339 timestamp can look like this:
2022-11-25T09:26:04+01:00. This is the format required by the Atom and JSONfeed specifications.
Perl’s standard module
Time::Piece has a simple string parsing functionality implementing the POSIX
The problem is that the
%z does not match a timezone designation in the format
So to use
Time::Piece to parse RFC 3339 dates, use the following Perl snippet:
my $string = "2022-11-25T09:26:04+01:00"; $string =~ s/:(\d+)$/$1/; # strip last colon my $ts = Time::Piece->strptime($string, "%FT%T%z"); # output Unix timestamp say $ts->epoch;
%F directive represents the date
%Y-%m-%d and is present as a GNU extension. It does not seem to be part of the original POSIX specification.
 For an exhaustive list of differences, see this page
date omits the separating
T from its
rfc-3339 output, but includes it in the
iso-8601 version. Both indicate the timezone with a colon.