DateTim...:W3CDTF(3)
π NAME π
okay bestie, meet DateTime::Format::W3CDTF β it parses and formats W3CDTF datetime strings. This is the User Contributed Perl Documentation page, and the manual name is DateTime::Format::W3CDTF(3) (the header shortens it to DateTim...:W3CDTF(3), which is giving truncation drama π
).
β¨ VERSION β¨
This document describes DateTime::Format::W3CDTF version 0.09. slay.
π SYNOPSIS π
use DateTime::Format::W3CDTF;
my $w3c = DateTime::Format::W3CDTF->new(strict => 1);
my $dt = $w3c->parse_datetime( '2003-02-15T13:50:05-05:00' );
# 2003-02-15T13:50:05-05:00
$w3c->format_datetime($dt);
π¦ DESCRIPTION π¦
This module understands the W3CDTF date/time format, an ISO 8601 profile, defined at http://www.w3.org/TR/NOTE-datetime. This format is the native date format of RSS 1.0. iconic behavior, honestly.
It can be used to parse these formats in order to create the appropriate objects. no cap π«Ά
π METHODS π
β οΈ Heads up: This API is currently experimental and may change in the future.
new()β Returns a new W3CDTF parser object. It accepts a single"strict"option:
DateTime::Format::W3CDTF->new(strict => 1);
If true, parse_datetime() and format_datetime() will only accept and return strings in W3CDTF format, respectively. In particular, the W3CDTF format requires all time components to have timezones.
If false, timezones are optional.
parse_datetime($string)β Given a W3CDTF datetime string, this method will return a new"DateTime"object.
If given an improperly formatted string, this method may die. π like, actually may die β be careful.
format_datetime($datetime)β Given a"DateTime"object, this method returns a W3CDTF datetime string.
NOTE: As of version 0.4, format_datetime no longer attempts to truncate datetimes without a time component. This is due to the fact that "DateTime" doesn't distinguish between a date with no time component, and midnight. important lore, bestie.
format_date($datetime)β Given a"DateTime"object, return a W3CDTF datetime string without the time component.
π«Ά SUPPORT π«Ά
Support for this module is provided via the datetime@perl.org email list. See http://datetime.perl.org/?MailingList for details.
Please submit bugs to the CPAN RT system at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=datetime-format-w3cdtf or via email at bug-datetime-format-w3cdtf@rt.cpan.org.
π AUTHOR π
Dave Rolsky <autarch@urth.org>
π CREDITS π
This module is maintained by Gregory Todd Williams <gwilliams@cpan.org>. It was originally created by Kellan Elliott-McCrea <kellan@protest.net>.
This module was inspired by DateTime::Format::ICal. cute inspiration moment β¨
π COPYRIGHT π
Copyright (c) 2009 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Copyright (c) 2003 Kellan Elliott-McCrea
Portions of the code in this distribution are derived from other works. Please see the CREDITS file for more details.
The full text of the license can be found in the LICENSE file included with this module.
β SEE ALSO β
datetime@perl.orgmailing listhttp://datetime.perl.org/
mwah π β source says perl v5.42.2, dated 2026-07-29, and the footer label is DateTim...:W3CDTF(3). byeee π«Άπ
π¦ where this page comes from
- arch rolling: perl-datetime-format-w3cdtf 0.09-1 Β· GPL AND PerlArtistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms