-
-
Save disulfidebond/b88773e7dcc333a89f37af752a8813b6 to your computer and use it in GitHub Desktop.
timestamp in bash
This file contains 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
#!/bin/sh | |
date | |
# outputs Fri Jan 25 12:10:33 CST 2019 | |
# alternative: add to bash_profile | |
timestamp() { | |
date +"%T" | |
} | |
# when timestamp is typed into bash, it outputs | |
# 12:10:25 | |
# alternative 2: format timestamp, this matches the timestamp-py.py gist | |
date "+%Y.%m.%d.%H.%M.%S" | |
# 2019.01.25.12.17.07 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment