echo date in shell script code example
Example 1: datetime echo shell script
$(date '+%d/%m/%Y %H:%M:%S')
Example 2: echo date in bash
date +'FORMAT'
### mm/dd/yyyy ###
date +'%m/%d/%Y'
## Time in 12 hr format ###
date +'%r'
## backup dir format ##
backup_dir=$(date +'%m/%d/%Y')
echo "Backup dir for today: /nas04/backups/${backup_dir}"