From: Stu Date: 2010-11-25T12:14:44+09:00 Subject: Re: date of 1 year ago nice. never knew you could do that with the shell command date. Here is a simple metaprogramming example class Integer def days sec = min = 60 day = 24 return( self * ( day * (sec * min))) end def years return( 365.days) end def ago return( Time.now - self) end end On Wed, Nov 24, 2010 at 8:49 PM, zuerrong wrote: > Hello, > > How does ruby get the date of 1 year ago? > like the result of with shell command: > > date -d '1 year ago' > > Thanks. > >