Question : date format in linux shell script
Answered by : venkatesh
date_now=$(date "+%F-%H-%M-%S")
Source : https://phoenixnap.com/kb/linux-date-command#ftoc-heading-10 | Last Update : Sat, 15 May 21
Question : date in - format linux
Answered by : devops-unicorn
# put current date as yyyy-mm-dd in $date
date=$(date '+%Y-%m-%d')
# put current date as yyyy-mm-dd HH:MM:SS in $date
date=$(date '+%Y-%m-%d %H:%M:%S')
# print current date directly
echo $(date '+%Y-%m-%d')
Source : https://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script | Last Update : Sat, 17 Sep 22