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
Posted Mar 31, 2016.
https://www.darklaunch.com/2016/03/31/bash-date-timestamp-format.html