linux shell get time code example
Example 1: datetime echo shell script
$(date '+%d/%m/%Y %H:%M:%S')
Example 2: current year bash
date +"%Y"
date +"%y"
## Store to a shell variable ##
mydate=$(date +'%Y')
myyear=`date +'%Y'`
echo "Year = $mydate"
echo "Year = $myyear"