1DateTime::Format::W3CDTUFs(e3r)Contributed Perl DocumentDaattieoTnime::Format::W3CDTF(3)
2
3
4
6 DateTime::Format::W3CDTF - Parse and format W3CDTF datetime strings
7
9 use DateTime::Format::W3CDTF;
10
11 my $w3c = DateTime::Format::W3CDTF->new;
12 my $dt = $w3c->parse_datetime( '2003-02-15T13:50:05-05:00' );
13
14 # 2003-02-15T13:50:05-05:00
15 $w3c->format_datetime($dt);
16
18 This module understands the W3CDTF date/time format, an ISO 8601
19 profile, defined at http://www.w3.org/TR/NOTE-datetime. This format as
20 the native date format of RSS 1.0.
21
22 It can be used to parse these formats in order to create the
23 appropriate objects.
24
26 This API is currently experimental and may change in the future.
27
28 · new()
29
30 Returns a new W3CDTF parser object.
31
32 · parse_datetime($string)
33
34 Given a W3CDTF datetime string, this method will return a new
35 "DateTime" object.
36
37 If given an improperly formatted string, this method may die.
38
39 · format_datetime($datetime)
40
41 Given a "DateTime" object, this methods returns a W3CDTF datetime
42 string.
43
44 NOTE: As of version 0.4, format_datetime no longer attempts to
45 truncate datetimes without a time component. This is due to the
46 fact that "DateTime" doesn't distinguish between a date with no
47 time component, and midnight.
48
49 · format_date($datetime)
50
51 Given a "DateTime" object, return a W3CDTF datetime string without
52 the time component.
53
55 Support for this module is provided via the datetime@perl.org email
56 list. See http://datetime.perl.org/?MailingList for details.
57
58 Please submit bugs to the CPAN RT system at
59 http://rt.cpan.org/NoAuth/ReportBug.html?Queue=datetime-format-w3cdtf
60 or via email at bug-datetime-format-w3cdtf@rt.cpan.org.
61
63 Dave Rolsky <autarch@urth.org>
64
66 This module is maintained by Gregory Todd Williams
67 <gwilliams@cpan.org>. It was originally created by Kellan Elliott-
68 McCrea <kellan@protest.net>.
69
70 This module was inspired by DateTime::Format::ICal
71
73 Copyright (c) 2009 David Rolsky. All rights reserved. This program is
74 free software; you can redistribute it and/or modify it under the same
75 terms as Perl itself.
76
77 Copyright (c) 2003 Kellan Elliott-McCrea
78
79 Portions of the code in this distribution are derived from other works.
80 Please see the CREDITS file for more details.
81
82 The full text of the license can be found in the LICENSE file included
83 with this module.
84
86 datetime@perl.org mailing list
87
88 http://datetime.perl.org/
89
90
91
92perl v5.30.0 2019-07-26 DateTime::Format::W3CDTF(3)