.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 .\" ======================================================================== .\" .IX Title "DateTime::Format::W3CDTF 3pm" .TH DateTime::Format::W3CDTF 3pm "2020-12-22" "perl v5.32.0" "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.08 .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 \s-1ISO 8601\s0 profile, defined at http://www.w3.org/TR/NOTE\-datetime. This format as the native date format of \s-1RSS 1.0.\s0 .PP It can be used to parse these formats in order to create the appropriate objects. .SH "METHODS" .IX Header "METHODS" This \s-1API\s0 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 \&\s-1NOTE:\s0 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't 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 \s-1CPAN RT\s0 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 \s-1CREDITS\s0 file for more details. .PP The full text of the license can be found in the \s-1LICENSE\s0 file included with this module. .SH "SEE ALSO" .IX Header "SEE ALSO" datetime@perl.org mailing list .PP http://datetime.perl.org/