On Thu, Jul 15, 2010 at 02:17:03PM -0400, Paul Miller wrote:
> How is seconds() different from in_units("seconds")? I don't see it.
> It doesn't produce the length of the duration in seconds. It produces
> subjectively speaking, the wrong numbers
"wrong" is subjective. :) The docs are pretty clear about why certain types
of unit conversions are not absolute, especially when timezones are thrown
into the mix. There are a multitude of different accessors and conversion
routines so you can tell the object just what you want to get back, so it
can perform the correct calculation.
> I have. I just don't understand why duration objects can't tell me
> their duration in the units I want and why it returns anything at all
> if it's actually refusing to do the conversion to seconds.
Can you give a specific example of what you are trying to achieve?
> > It returns the duration in X units. So a duration could be 2 months, 3
> > days, 4 hours, and 5 seconds. There's no way to determine a length in
> > seconds from that.
>
> There is, but people may not generally agree on the units. You could
> just make them adjustable or come up with a standard that people can
> agree on, or maybe produce an error when it seems clear someone is
> trying to do a conversion that doesn't make sense to you.
This functionality already exists.
(PS. Hello fellow skydiver - 46 jumps/~30 min freefall here.)
--
"When religion and politics travel in the same cart, the riders
believe nothing can stand in their way." - Frank Herbert
. . . . .
Karen Etheridge, [email protected] GCS C+++$ USL+++$ P+++$ w--- M++
http://etheridge.ca/ PS++ PE-- b++ DI++++ e++ h(-)