Skip to content

Instantly share code, notes, and snippets.

@sanderv32
Forked from ph3nx/timestamp.rb
Created April 26, 2016 19:46
Show Gist options
  • Save sanderv32/e410d06208dc9d68227b7ae44e9161fe to your computer and use it in GitHub Desktop.
Save sanderv32/e410d06208dc9d68227b7ae44e9161fe to your computer and use it in GitHub Desktop.
Handy method to get the current unix time stamp in Ruby. Unix time, or POSIX time, is a system for describing instants in time, defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970.
def timestamp
Time.now.to_i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment