Bjørn-Olav Strand > DateTime-Format-Duration-DurationString-0.03 > DateTime::Format::Duration::DurationString

Download:
DateTime-Format-Duration-DurationString-0.03.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.03   Source  

NAME ^

DateTime::Format::Duration::DurationString - JIRA style parsing of duration

VERSION ^

Version 0.03

SYNOPSIS ^

  package MyApp;
  use DateTime::Format::Duration::DurationString;
  
  my $seconds  = DateTime::Format::Duration::DurationString->new()->parse('1d 3h')->to_seconds;
  my $duration = DateTime::Format::Duration::DurationString->new()->parse('1d 3h')->to_duration;

DESCRIPTION ^

DateTime::Format::Duration::DurationString parses a string and returns a duration.

to_seconds

Return this object as seconds

to_duration

Return this object as a DateTime::Duration

parse

Parse a string

TODO ^

Parsestring in constructor?

SEE ALSO ^

DateTime, DateTime::Duration and DateTime::Format::Duration

AUTHOR ^

Bjørn-Olav Strand <bo@startsiden.no>

LICENSE ^

Copyright 2009 by ABC Startsiden AS, Bjørn-Olav Strand <bo@startsiden.no>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: