Created
December 20, 2024 02:52
-
-
Save svoboda-jan/a3fc0855eae13d9a79e79753d66201cf to your computer and use it in GitHub Desktop.
Generate an Unix timestamp in Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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