xxxxxxxxxx
current_time=$(date +%T)
echo "Current time is: $current_time"
xxxxxxxxxx
Open a terminal and type the following command:
date
Sat Nov 7 22:44:59 IST 2020
You can format the date as follows in dd-mm-yy format:
date +"%d-%m-%y"
07-11-2020