From: rlf Date: 2010-11-25T22:10:28+09:00 Subject: Re: date of 1 year ago On Nov 25, 3:11 am, Stu wrote: > On Wed, Nov 24, 2010 at 10:05 PM, zuerrong wrote: > > 2010/11/25 Stu : > > >>  def years > >>    year = 365 > > > Well, how do you know every year has exactly 365 days? > > I don't think this is a standard method for date calc. > > I was just trying to get you to closer to the syntax of your gnu date > program. As I mentioned Date has it's own leap year boolean object. Of > course you can always program your own leap year algorithm with a > couple modulo operations. This way year can return the extra day you > get every four years. > > Good luck and happy hacking =) Besides overriding the plus and minus operators to deal with days, the Date class also employs the shift operators to deal with months. So try: Date.today << 12 It deals with the leap year issue as well.