From: Mike McKinney Date: 2008-01-14T11:22:35+09:00 Subject: Re: regualr expression (need help) ------=_Part_7811_33248319.1200277360607 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline na, you are trying to execute the "-" method on a string (which doesn't exist) if you have two dates, you can execute the "-" method just fine (result is a Rational) try this: require 'date' date_one = Date.parse('2008-01-01') date_two = Date.parse('2008-02-02') puts "date_one = #{date_one}" puts "date_two = #{date_two}" diff = date_two - date_one puts "date_two - date_one = #{diff} (class:#{diff.class})" puts "date_one + diff.to_i = #{date_one + diff.to_i}" output: date_one = 2008-01-01 date_two = 2008-02-02 date_two - date_one = 32 (class:Rational) date_one + diff.to_i = 2008-02-02 M On Jan 13, 2008 8:41 PM, Ken Bloom wrote: > On Sun, 13 Jan 2008 14:37:35 -0500, louis wrote: > > > that did help a lot! thanks! now i have to find/read more on what's in > > the core that needs 'requiring'. thanks again! > > I've noticed that. I think it's a bug on ruby-docs.org that somebody > needs to fix. > > --Ken > > -- > Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory. > Department of Computer Science. Illinois Institute of Technology. > http://www.iit.edu/~kbloom1/ > > ------=_Part_7811_33248319.1200277360607--