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 $f = DateTime::Format::W3CDTF->new;
12 my $dt = $f->parse_datetime( '2003-02-15T13:50:05-05:00' );
13
14 # 2003-02-15T13:50:05-05:00
15 $f->format_datetime($dt);
16
18 This module understands the W3CDTF date/time format, an ISO 8601 pro‐
19 file, 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 appropri‐
23 ate objects.
24
26 This API is currently experimental and may change in the future.
27
28 * parse_datetime($string)
29 Given a W3CDTF datetime string, this method will return a new
30 "DateTime" object.
31
32 If given an improperly formatted string, this method may die.
33
34 * format_datetime($datetime)
35 Given a "DateTime" object, this methods returns a W3CDTF datetime
36 string.
37
38 NOTE: As of version 0.4, format_datetime no longer attempts to
39 truncate datetimes without a time component. This is due to the
40 fact that "DateTime" doesn't distinguish between a date with no
41 time component, and midnight.
42
43 * format_date($datetime)
44 Given a "DateTime" object, return a W3CDTF datetime string without
45 the time component.
46
48 Support for this module is provided via the datetime@perl.org email
49 list. See http://lists.perl.org/ for more details.
50
52 Kellan Elliott-McCrea <kellan@protest.net>
53
54 This module was inspired by "DateTime::Format::ICal"
55
57 Copyright (c) 2003 Kellan Elliott-McCrea. All rights reserved. This
58 program is free software; you can redistribute it and/or modify it
59 under the same terms as Perl itself.
60
61 The full text of the license can be found in the LICENSE file included
62 with this module.
63
65 datetime@perl.org mailing list
66
67 http://datetime.perl.org/
68
69
70
71perl v5.8.8 2003-11-23 DateTime::Format::W3CDTF(3)