DateTime-Format-XSD-0.2/0000755000175000017500000000000011524020357014030 5ustar ruosoruosoDateTime-Format-XSD-0.2/Changes0000644000175000017500000000011011524020032015301 0ustar ruosoruoso0.2 - Drop unecessary requirement for perl 5.8.8 0.1 - Initial Revision DateTime-Format-XSD-0.2/MANIFEST0000644000175000017500000000023411006047033015153 0ustar ruosoruosoChanges lib/DateTime/Format/XSD.pm Makefile.PL MANIFEST README t/01-basics.t META.yml Module meta-data (added by MakeMaker) DateTime-Format-XSD-0.2/README0000644000175000017500000000170611006046173014713 0ustar ruosoruosoNAME DateTime::Format::XSD - Format DateTime according to xsd:dateTime SYNOPSIS my $str = DateTime::Format::XSD->format_datetime($dt); DESCRIPTION XML Schema defines a usage profile which is a subset of the ISO8601 profile. This profile defines that the following is the only possible representation for a dateTime, despite all other options ISO provides. YYYY-MM-DD"T"HH:MI:SS(Z|[+-]zh:zm) This module is a subclass of DateTime::Format::ISO8601, therefore it will be able to parse all other ISO options, but will only format it in this exact spec. SEE ALSO DateTime, DateTime::Format::ISO8601, The XML Schema speficitation. AUTHORS Daniel Ruoso "daniel@ruoso.com" BUG REPORTS Please submit all bugs regarding "DateTime::Format::XSD" to "bug-datetime-format-xsd@rt.cpan.org" LICENSE This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. DateTime-Format-XSD-0.2/t/0000755000175000017500000000000011524020357014273 5ustar ruosoruosoDateTime-Format-XSD-0.2/t/01-basics.t0000644000175000017500000000055711006047007016145 0ustar ruosoruoso#!/usr/bin/perl use strict; use warnings; use Test::More tests => 2; use_ok('DateTime::Format::XSD'); { package PseudoDateTime; sub strftime { '2008-04-30T11:42:00+0100'; } } my $dt = bless {}, 'PseudoDateTime'; my $out = DateTime::Format::XSD->format_datetime($dt); is($out, '2008-04-30T11:42:00+01:00', 'Correctly forces timezone style.'); DateTime-Format-XSD-0.2/lib/0000755000175000017500000000000011524020357014576 5ustar ruosoruosoDateTime-Format-XSD-0.2/lib/DateTime/0000755000175000017500000000000011524020357016272 5ustar ruosoruosoDateTime-Format-XSD-0.2/lib/DateTime/Format/0000755000175000017500000000000011524020357017522 5ustar ruosoruosoDateTime-Format-XSD-0.2/lib/DateTime/Format/XSD.pm0000644000175000017500000000241211524020014020503 0ustar ruosoruoso{ package DateTime::Format::XSD; use strict; use warnings; use base qw(DateTime::Format::ISO8601); our $VERSION = '0.2'; sub format_datetime { my ($format, $date) = @_; my $out = $date->strftime('%FT%T%z'); $out =~ s/(\d\d)$/:$1/; return $out; } }; 1; =head1 NAME DateTime::Format::XSD - Format DateTime according to xsd:dateTime =head1 SYNOPSIS my $str = DateTime::Format::XSD->format_datetime($dt); =head1 DESCRIPTION XML Schema defines a usage profile which is a subset of the ISO8601 profile. This profile defines that the following is the only possible representation for a dateTime, despite all other options ISO provides. YYYY-MM-DD"T"HH:MI:SS(Z|[+-]zh:zm) This module is a subclass of DateTime::Format::ISO8601, therefore it will be able to parse all other ISO options, but will only format it in this exact spec. =head1 SEE ALSO L, L, The XML Schema speficitation. =head1 AUTHORS Daniel Ruoso C =head1 BUG REPORTS Please submit all bugs regarding C to C =head1 LICENSE This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =cut DateTime-Format-XSD-0.2/META.yml0000644000175000017500000000110411524020357015275 0ustar ruosoruoso--- #YAML:1.0 name: DateTime-Format-XSD version: 0.2 abstract: Format DateTime according to xsd:dateTime author: - Daniel Ruoso license: unknown distribution_type: module configure_requires: ExtUtils::MakeMaker: 0 build_requires: ExtUtils::MakeMaker: 0 requires: DateTime::Format::ISO8601: 0 no_index: directory: - t - inc generated_by: ExtUtils::MakeMaker version 6.56 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 DateTime-Format-XSD-0.2/Makefile.PL0000644000175000017500000000106311524020037015775 0ustar ruosoruosouse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'DateTime::Format::XSD', VERSION_FROM => 'lib/DateTime/Format/XSD.pm', # finds $VERSION PREREQ_PM => { DateTime::Format::ISO8601 => 0 }, ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'lib/DateTime/Format/XSD.pm', # retrieve abstract from module AUTHOR => 'Daniel Ruoso ') : ()), );