Created
January 25, 2019 18:17
-
-
Save scienceystuff/9c8f7954b3109556f04709c0031ceec2 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