Skip to content

Instantly share code, notes, and snippets.

@yuheiomori
Created August 5, 2009 03:01
Show Gist options
  • Select an option

  • Save yuheiomori/162457 to your computer and use it in GitHub Desktop.

Select an option

Save yuheiomori/162457 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'activesupport'
tomorrow = Time.now
after_week = tomorrow.advance :days => 7
puts "#{ tomorrow.strftime "%Y%m%d"},#{after_week.strftime "%Y%m%d"}"
(1..300).each{|x|
tomorrow = tomorrow.advance(:weeks=>x)
after_week = after_week.advance(:weeks=>x)
puts "#{ tomorrow.strftime "%Y%m%d"},#{after_week.strftime "%Y%m%d"}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment