From: Shiwei Zhang Date: 2007-01-09T18:58:12+09:00 Subject: Re: how to get 1 month in the future --------------080901030100050903050209 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit <=>, >>, %w, define?, .., ... are actually nice in RUBY, although I felt they were boring when I firstly saw them. def month_list(start_y,start_m,end_y,end_m) st = Date.civil(start_y,start_m); et = Date.civil(end_y,end_m); while((st<=>et)!=1) p st.to_s; st>>=1; end end Shiwei ((The views expressed are my own and not necessarily those of Oracle and its affiliates.)) shawn bright wrote: > Hello there all, i am writing a function that will create a list of > all the > months between two given dates > > def month_list ( start_y, start_m, finish_y, finish_m) # start and end > month > and year > start = Time.mktime(start_y, start_m, 1) > end = Time.mktime(finish_y, finish_m) > > not_finished = 1 > while not_finished == 1 do > > #somehow get 1 month from start > > > end > > This is as far as i have gotten so far. What i mostly need to know is, > how > do i get a datetime object > that is 1 month from start ? > > thanks > > shawn > --------------080901030100050903050209--