Last active
September 13, 2022 14:54
-
-
Save kristopherjohnson/d2d5709b7ddd94dff15bbee0f753853e to your computer and use it in GitHub Desktop.
Ruby: Generate a timestamp string
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
# Return 'YYYY-MM-DD HH:MM:SS' string for current time, using local timezone. | |
def timestamp() | |
Time.now.strftime '%Y-%m-%d %H:%M:%S' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment