maybe you want to use Time?

arr = []
hour1 = Time.gm(2000,"jan",1,8,0)
hour2 = Time.gm(2000,"jan",1,9,0)
while hour1 <= hour2
  arr << hour1.hour.to_s + ":" + hour1.min.to_s.rjust(2,"0")
  hour1 += 60
end

p arr

Jermaine O. wrote in post #1075780:
> Hello everybody,
>
> I'm looking for a way to create an array out of a range, but does the
> counting as like it's a time object. So for instance:
>
> (800..900).to_a (which represents: 08:00 - 09:00)
> will generate an array something like this:
>
> #=> [800,801,802,...... 899, 900]
>
> Whereas I would like the output to be like this:
>
> #=> [800,801,802,...... 859, 900]
>
> Basically it should bump to the next major number (hour) after 59
> instead of going all the way up to 99.
>
> How should I go about doing this?
>
> Thanks!

-- 
Posted via http://www.ruby-forum.com/.