If this is on the CPAN, please let me know. I can't find it. If not, we probably need it at work.
The W3C duration standard (http://www.w3.org/TR/xmlschema-2/#duration), derived from the ISO 8601 duration standard, allows one to specify durations in a format like PnYnMnDTnHnMnS (e.g.: "P1Y2MT2H", a duration of one year, two months and two hours). I can't find a proper parser for it and it turns out to have some tricky bits. Basically, I want to do this: my $duration = DateTime::Duration::W3C->new("P1Y2MT2H"); Which would be more or less equivalent to: my $duration = DateTime::Duration->new( years => 1, months => 2, hours => 2, ); I can write this and try to handle the special cases I find documented (I'll be damned if I'm going to pay 130 Swiss Francs for the damned ISO 8601 standard), but I'd love to know if it's already out there. Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog - http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6
