Skip to content

Instantly share code, notes, and snippets.

@lanrion
Created August 20, 2014 18:44
Show Gist options
  • Save lanrion/65c4ea3190fee8271880 to your computer and use it in GitHub Desktop.
Save lanrion/65c4ea3190fee8271880 to your computer and use it in GitHub Desktop.
Iterating Through Time With Rails

循环时间:

Range.new(Time.now.to_i, 5.days.from_now.to_i).step(1.day) do |seconds_since_epoch|
  time = Time.at(seconds_since_epoch)
  puts time
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment