From: Justin Collins Date: 2005-09-28T06:17:53+09:00 Subject: Re: Time interval --------------010508030200020505080006 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Daniel Berger wrote: > Hi all, > > I was just wondering if anyone has implemented an "Interval" class of > some sort out there, i.e. something that would give you the years, > months, days, hours, minutes and seconds between two fixed DateTime > objects, rather than an absolute date. > > I see that Gavin Sinclair brought this issue up a couple times last > year (ruby-talk:95236, ruby-talk:103601), but I didn't see any sort of > package on the RAA. > > I had something of my own with "fixed-time" but it doesn't handle > Date, Time or DateTime objects (i.e. it needs a major makeover). > Before I do that, though, I wanted to see if anyone out there (Gavin?) > already had something out there, sitting on their hard drive, but > unreleased. > > Regards, > > Dan > > PS - I'm very confused by the current implementation of "-" (minus) > for Date and DateTime, where the returned value is a Rational. Can > someone elaborate on how this is used? > You may wish to look into Runt - http://raa.ruby-lang.org/project/runt/ From the description: Runt is an implementation of select temporal patterns by Martin Fowler in the super-fantastic Ruby language. Runt provides: * recurring events defined using simple, set-like expressions * an API for creating schedules for arbitrary events/objects * precisioned date types using Time Points * date Ranges * everlasting peace and/or eternal life -Justin --------------010508030200020505080006--