get current time in linux code example
Example 1: get current server time centos
timedatectl
Example 2: shell script current time
#!/bin/bash
now="$(date)"
printf "Current date and time %s\n" "$now"
now="$(date +'%d/%m/%Y')"
printf "Current date in dd/mm/yyyy format %s\n" "$now"
echo "Starting backup at $now, please wait..."
# command to backup scripts goes here
# ...