hi all
how to do a iterative for Time object,
i.e.
i wanna iterative from 2000/05/05 to now, output to a array
regards
···
--
Posted via http://www.ruby-forum.com/.
hi all
how to do a iterative for Time object,
i.e.
i wanna iterative from 2000/05/05 to now, output to a array
regards
--
Posted via http://www.ruby-forum.com/.
joe wrote:
how to do a iterative for Time object,
i.e.
i wanna iterative from 2000/05/05 to now, output to a array
(time_a..time_b).to_a
Daniel
joe wrote:
hi all
how to do a iterative for Time object,
i.e.
i wanna iterative from 2000/05/05 to now, output to a arrayregards
Date supports iteration:
startDate = Date.parse('2000/05/05')
days =
startDate.upto(Date.today){|day| days << day}
cheers
--
Posted via http://www.ruby-forum.com/\.