On Fri, 14 Nov 2003, Dave Rolsky wrote: > I don't mind the idea of adding a compare() class method that accepts a > base datetime and uses DateTime->now, per Rick's suggestion.
I proposed something just short of this *months* ago and nobody even responded to my RFC. DT::Q could be either used by this 'compare' class or be extended to include comparison operators. Two DT::Q objects could be compared deterministically. -J -- > From [EMAIL PROTECTED] Fri Nov 14 17:40:01 2003 > Date: Sun, 17 Aug 2003 16:02:09 -1000 (HST) > From: Joshua Hoblitt <[EMAIL PROTECTED]> > To: DateTime <[EMAIL PROTECTED]> > Subject: [RFC] DateTime::Quantitative was Re: Subtraction Broken? > > I'm not too sure about the name. I wanted to make sure it couldn't be confused with > DateTime::Duration and still be meaningful. > > Is this the best approach? I can't see this type of functionality being cleanly > implemented in DT::Duration. > > -J > > -- > DateTime::Quantitative - returns duration values normalized to a fixed point in time > > ->new( datetime => $dt, duration => $dtd ) > > Like DT::Duration it would provide: > > ->years; > ->months; > ->weeks; > ->days; > ->hours; > ->minutes; > ->seconds; > ->nanoseconds; > ->sign; > ->is_positive > ->is_zero > ->is_negative > > In addition: > > ->clone > > ->datetime > ->duration > > returns the component object > > If DT::Q is mutable (might not be a good idea) it would also include: > > ->set_datetime( object => $dt ) > ->set_duration( object => $dtd ) > > updates the component object > > No math operators would be overloaded but perhaps stringification would be allowed. >