On Wed, 26 Jan 2005, Leonardo Herrera wrote:

Todd Goldenbaum wrote:

I see now, that did the trick. My mistake was assuming that $duration->days would give the same result as $duration->delta_days( $start_date ) or $duration->in_units('days').


I'm curious now though, what >is< $duration->days used for, if not for expressing the length in days of a $duration?

I *believe* it is so you can say "X months, Y days and Z hours" or things like that.

More like "2 weeks and 4 days". If I'd known Rick Measham was going to write DateTime::Format::Duration, which does a much better job of turning durations into different outputs, I'd never have put these methods in, and only put in the minimum needed for math.


Oh well, hindsight and all that. I think I'll add a big pointer to DT::F::Duration in the DT::Duration docs though.


-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/

Reply via email to