logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

XML::Feed::Util - Utility functions

Description

       Common utility or helper functions.

Name

       XML::Feed::Util - Utility functions

Synopsis

           use XML::Feed::Util qw(
               format_w3cdtf
               parse_datetime
               parse_mail_date
               parse_w3cdtf_date
           );
           use DateTime;

           print format_w3cdtf(DateTime->now);

           my $dt;
           $dt = parse_datetime('January 8, 1999');
           $dt = parse_mail_date('Fri, 23 Nov 2001 21:57:24 -0600');
           $dt = parse_w3cdtf_date('2003-02-15T13:50:05-05:00');

Usage

format_w3cdtf($datetime)
       Convert DateTime object to W3CDTF format string.  Uses default timezone "Z" for "floating" DateTime.

   parse_datetime($date)
       Parse any date string using DateTime::Format::ISO8601, DateTime::Format::Flexible or
       DateTime::Format::Natural.

       Returns DateTime object or undef.

   parse_mail_date($date)
       Parse date in RFC2822/822 format using DateTime::Format::Mail.  Fallback to parse_datetime() for other
       formats.

       Returns DateTime object or undef.

   parse_w3cdtf_date($date)
       Parse date W3CDTF format using DateTime::Format::W3CDTF.  Fallback to parse_datetime() for other formats.

       Returns DateTime object or undef.

See Also