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 · parse_datetime($string)
29
30 Given a W3CDTF datetime string, this method will return a new
31 "DateTime" object.
32
33 If given an improperly formatted string, this method may die.
34
35 · format_datetime($datetime)
36
37 Given a "DateTime" object, this methods returns a W3CDTF datetime
38 string.
39
40 NOTE: As of version 0.4, format_datetime no longer attempts to
41 truncate datetimes without a time component. This is due to the
42 fact that "DateTime" doesn't distinguish between a date with no
43 time component, and midnight.
44
45 · format_date($datetime)
46
47 Given a "DateTime" object, return a W3CDTF datetime string without
48 the time component.
49
51 Support for this module is provided via the datetime@perl.org email
52 list. See http://datetime.perl.org/?MailingList for details.
53
54 Please submit bugs to the CPAN RT system at
55 http://rt.cpan.org/NoAuth/ReportBug.html?Queue=datetime-format-w3cdtf
56 or via email at bug-datetime-format-w3cdtf@rt.cpan.org.
57
59 Dave Rolsky <autarch@urth.org>
60
62 This module was originally created by Kellan Elliott-McCrea
63 <kellan@protest.net>.
64
65 This module was inspired by DateTime::Format::ICal
66
68 Copyright (c) 2009 David Rolsky. All rights reserved. This program is
69 free software; you can redistribute it and/or modify it under the same
70 terms as Perl itself.
71
72 Copyright (c) 2003 Kellan Elliott-McCrea
73
74 Portions of the code in this distribution are derived from other works.
75 Please see the CREDITS file for more details.
76
77 The full text of the license can be found in the LICENSE file included
78 with this module.
79
81 datetime@perl.org mailing list
82
83 http://datetime.perl.org/
84
85
86
87perl v5.12.0 2010-04-30 DateTime::Format::W3CDTF(3)