I want to get date time in YYYY-MM-DD HH:MM:SS format in my script. Is there any way to format the output of date command?
You can format the output of the date command to get datetime in YYYY-MM-DD HH:MM:SS format.
$ date +"%Y-%m-%d %T"2019-09-11 19:18:31