XML::Feed::Util(3pm)

πŸ’– XML::Feed::Util πŸ’–

okay so bestie, quick vibe check: this is the manual page for XML::Feed::Util, and it lives in the User Contributed Perl Documentation section of your friendly neighbourhood 3pm manpages. it's a whole little toolbox of date-and-feed helpers that XML::Feed pulls in when it needs to not lose its mind over timestamps 🫢


✨ NAME ✨

XML::Feed::Util β€” Utility functions πŸ’…

like. that's the whole pitch. utility functions. iconic, honestly.


🌸 SYNOPSIS 🌸

drop this at the top of your file and you're off to the races:

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');

see how it's giving clean import list, sensible DateTime object, three different date formats parsed like it's nothing? yeah. that's the energy 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

Common utility or helper functions. πŸŽ€

that's it, that's the description. no lore, no drama, just a tiny grab-bag of helpers that other stuff leans on. it's giving support-system bestie.


πŸŽ€ USAGE πŸŽ€

here's the roster, one by one πŸ‘‘

format_w3cdtf($datetime)

takes a DateTime object and turns it into a W3CDTF format string ✨

and here's the lil' detail you don't wanna sleep on: for a "floating" DateTime it uses the default timezone "Z". no cap.

parse_datetime($date)

parses literally any date string by throwing it at DateTime::Format::ISO8601, DateTime::Format::Flexible or DateTime::Format::Natural 🌸

returns a DateTime object, or undef if it can't make sense of your nonsense πŸ™ˆ

parse_mail_date($date)

parses a date in RFC2822/822 format using DateTime::Format::Mail πŸ“¬

and if that doesn't work out? it falls back to parse_datetime() for other formats. versatile queen πŸ’…

returns a DateTime object, or undef.

parse_w3cdtf_date($date)

parses a date in W3CDTF format using DateTime::Format::W3CDTF πŸ¦‹

same deal as above: fallback to parse_datetime() for other formats when the strict parser says no.

returns a DateTime object, or undef.


heads up bestie: every one of these three parsers can hand you back undef instead of a DateTime. so like, actually check your return value before you go calling methods on it, okay? πŸ’–

Please see the XML::Feed manpage for author, copyright, and license information.

(translation: the receipts live over there, go look πŸ’œ)


okay and that's the whole page!! slay. this little cutie is XML::Feed::Util(3pm), part of the User Contributed Perl Documentation, and it rode in with perl v5.40.1 dated 2026-02-21 ⭐ so yeah, go forth and parse those dates, main character πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from