Skip to content

Instantly share code, notes, and snippets.

@mulder
Created November 24, 2009 16:06
Show Gist options
  • Save mulder/241972 to your computer and use it in GitHub Desktop.
Save mulder/241972 to your computer and use it in GitHub Desktop.
Random Time
def random_time(no_older_then = 432000, now = Time.now)
oldest = now - no_older_then
Time.at(rand(no_older_then) + oldest.to_i)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment