Skip to content

Instantly share code, notes, and snippets.

@svoboda-jan
Created December 20, 2024 02:52
Show Gist options
  • Save svoboda-jan/a3fc0855eae13d9a79e79753d66201cf to your computer and use it in GitHub Desktop.
Save svoboda-jan/a3fc0855eae13d9a79e79753d66201cf to your computer and use it in GitHub Desktop.
Generate an Unix timestamp in Ruby
# Generate an Unix timestamp in Ruby
# If you don't want to use:
Time.now.strftime("%s")
# or
Time.now.to_i
# Then you can also alias the to_i method:
Time.alias_method :unix_timestamp, :to_i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment