how to print system time using shellscript code example
Example 1: shell script current time
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}"
Example 2: unix get time
user@machine:~$ date
Tue Jan 12 09:22:56 UTC 2021