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
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://lists.perl.org/ for more details.
53
55 Kellan Elliott-McCrea <kellan@protest.net>
56
57 This module was inspired by "DateTime::Format::ICal"
58
60 Copyright (c) 2003 Kellan Elliott-McCrea. All rights reserved. This
61 program is free software; you can redistribute it and/or modify it
62 under the same terms as Perl itself.
63
64 The full text of the license can be found in the LICENSE file included
65 with this module.
66
68 datetime@perl.org mailing list
69
70 http://datetime.perl.org/
71
72
73
74perl v5.10.1 2003-11-24 DateTime::Format::W3CDTF(3)