Bash date timestamp format

Create a timestamp in bash using the date command invoked with a format string.

$ date "+%Y-%m-%d %H:%M:%S"
2016-03-31 10:10:31
$ echo "$(date "+%Y-%m-%d %H:%M:%S")"
2016-03-31 10:10:31
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment