From: Charles Comstock Date: 2004-04-01T07:44:25+09:00 Subject: Re: Representing Time Ranges (Difference) Matthew Lipper wrote: > Hi Charles, > > I've been busier than a one-legged man at an ass-kicking contest, so > apologies if this has been covered in the five days worth of posts I > just speed-read... > > Charles Comstock wrote in message news:... > >>Is there a nice library for representing Time differences? > > > Well, there's definitely an ugly one: > > http://runt.rubyforge.org/doc/classes/Runt/DateRange.html > > in Runt. DateRange enhances the default Date/DateTime/Range > functionality to include the ability to iterate through a date range > using various level of precision (hour, minute, etc.) > > It does this in cooperation with > > http://runt.rubyforge.org/doc/classes/Runt/DatePrecision.html > > and > > http://runt.rubyforge.org/doc/classes/Runt/TimePoint.html > > > Code is ugly and/or incomplete, documentation is sparse and you should > use CVS HEAD if at all possible. > > When I have a free moment, I am going to act upon some insightful > suggestions [1] regarding the syntactic conventions used in Runt; at > that point I will release a more Ruby-esque implementation... > > Regards, > > Matt > > [1] See: > > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&frame=right&th=b25def0bd29d9899&seekm=74559ebc.0403250743.271dfe53%40posting.google.com#link14 > > BTW: Thank you Hal, Mauricio, and Mark! Hal, double thanks, for the > correspondence! Hmm, perhaps I scanned it too quickly, but this feels more like a library to manipulate date ranges, as opposed to formatting a time span. Basically I want to be able to represent time spans in a more meaningful manner then individual seconds. I know all I need to do is do a bunch of divide / modulus operations to find this out, but I was wondering if there was a prewritten module to nicely format time spans and allow easy access to the number of months, days, hours, seconds in between to time or date objects. Charles Comstock