sudo date --set "07 DEC 2018 3:00 PM"
We'll be using timedatectl to achieve this. But first, make sure to turn off ntp a TCP/IP protocol for synchronizing time over a network. Basically a client requests the current time from a server, and uses it to set its own clock. That's why no matter how many times you change the date of your server but still the date and time is the same.
Disable NTP
sudo timedatectl set-ntp 0
Set the date and time
sudo timedatectl set-time "2018-12-07 15:00:00"
Check if date and time has been changed
sudo date
To enable NTP and return to original date and time
sudo timedatectl set-ntp 1
No comments:
Post a Comment