Skip to content

Instantly share code, notes, and snippets.

@yosmoc
Created January 15, 2009 15:02
Show Gist options
  • Save yosmoc/47428 to your computer and use it in GitHub Desktop.
Save yosmoc/47428 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
timing = [1, 7, 14, 30]
now = Time.now
result = timing.inject(now) do |res, t|
p res.strftime("%Y/%m/%d")
res + t * 24 * 60 * 60
end
p result.strftime("%Y/%m/%d")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment