Set date from the command line
date +%Y%m%d -s "20120418"
Set time from the command linedate +%T -s "11:14:00"
Set time and date from the command linedate -s "19 APR 2012 11:14:00"
Linux check date from command linedate
Will show you something like this:Thu Apr 19 15:17:34 BOT 2012
Set hardware clockhwclock --show
Will output something like this:Thu 19 Apr 2012 03:23:05 PM BOT -0.785086 seconds
Now check the system clockdate
Will output something like this:Thu Apr 19 15:26:41 BOT 2012
Let's set the hardware clock to local time:hwclock --set --date="2012-04-19 16:45:05" --localtime
If you want to set it to UTC time use:hwclock --set --date="2011-04-19 20:45:05" --utc
Reference: https://www.garron.me/en/linux/set-time-date-timezone-ntp-linux-shell-gnome-command-line.html