.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "DateTime::Format::W3CDTF 3" .TH DateTime::Format::W3CDTF 3 2026-07-29 "perl v5.42.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME DateTime::Format::W3CDTF \- Parse and format W3CDTF datetime strings .SH VERSION .IX Header "VERSION" This document describes DateTime::Format::W3CDTF version 0.09 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use DateTime::Format::W3CDTF; \& \& my $w3c = DateTime::Format::W3CDTF\->new(strict => 1); \& my $dt = $w3c\->parse_datetime( \*(Aq2003\-02\-15T13:50:05\-05:00\*(Aq ); \& \& # 2003\-02\-15T13:50:05\-05:00 \& $w3c\->format_datetime($dt); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module understands the W3CDTF date/time format, an ISO 8601 profile, defined at http://www.w3.org/TR/NOTE\-datetime. This format as the native date format of RSS 1.0. .PP It can be used to parse these formats in order to create the appropriate objects. .SH METHODS .IX Header "METHODS" This API is currently experimental and may change in the future. .IP \(bu 4 \&\fBnew()\fR .Sp Returns a new W3CDTF parser object. Accepts a single \f(CW\*(C`strict\*(C'\fR option: .Sp .Vb 1 \& DateTime::Format::W3CDTF\->new(strict => 1); .Ve .Sp If true, \fBparse_datetime()\fR and \fBformat_datetime()\fR will only accept and return strings in W3CDTF format, respectively. In particular, the W3CDTF format requires all time components to have timezones. .Sp If false, timezones are optional. .IP \(bu 4 parse_datetime($string) .Sp Given a W3CDTF datetime string, this method will return a new \&\f(CW\*(C`DateTime\*(C'\fR object. .Sp If given an improperly formatted string, this method may die. .IP \(bu 4 format_datetime($datetime) .Sp Given a \f(CW\*(C`DateTime\*(C'\fR object, this methods returns a W3CDTF datetime string. .Sp 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 \f(CW\*(C`DateTime\*(C'\fR doesn\*(Aqt distinguish between a date with no time component, and midnight. .IP \(bu 4 format_date($datetime) .Sp Given a \f(CW\*(C`DateTime\*(C'\fR object, return a W3CDTF datetime string without the time component. .SH SUPPORT .IX Header "SUPPORT" Support for this module is provided via the datetime@perl.org email list. See http://datetime.perl.org/?MailingList for details. .PP 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. .SH AUTHOR .IX Header "AUTHOR" Dave Rolsky .SH CREDITS .IX Header "CREDITS" This module is maintained by Gregory Todd Williams . It was originally created by Kellan Elliott\-McCrea . .PP This module was inspired by DateTime::Format::ICal .SH COPYRIGHT .IX Header "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. .PP Copyright (c) 2003 Kellan Elliott\-McCrea .PP Portions of the code in this distribution are derived from other works. Please see the CREDITS file for more details. .PP The full text of the license can be found in the LICENSE file included with this module. .SH "SEE ALSO" .IX Header "SEE ALSO" datetime@perl.org mailing list .PP http://datetime.perl.org/