Flavio S. Glock wrote:
> BTW, how about adding a simple formatter to DT::Duration,
> something like a stripped down DateTime::Format::ICal->format_duration ?

This would be really good. I actually rolled my own duration for some
subtractions I was doing because I wasn't real happy with the current one.
I'd like to be able to do things like:

$dd->normalise( base => $dt );
Which would turn 26 hours into 1 day, 2 hours. 
Which would turn 34 days into 1 month, 3 days if base is in a 31 day month

$dd->as_seconds
Returns the duration in fractional seconds. 1 days becomes 86400.00

$dd->seconds
Return the seconds in the duration. If we've normalised, this will be
between 0 and 59

$dd->as____ and $dd->___ would also exist.

Then there'd be
$dd->as( 'hours', 'minutes');
returning as array where the duration is returned as hours and minutes. The
last element of the array would be a float.

Cheers!
Rick


-- 
Obviously the reply-to is a fake. Just change the 'spam-' to 'i' so that the
result sounds like why you go to an optometerist.

Reply via email to