11

I have tried below commands to change date and time but these are not updating date and time.

sudo date --set="2015-09-30 10:05:59.990"
sudo date --set="Tue 30 May 2017 15:00:00"

sudo hwclock --systohc

Kindly provide valid commands for changing date and time

22

You can use timedatectl, it does all the necessary things for you itself.

First make sure NTP is not enabled:

sudo timedatectl set-ntp 0

then set the time:

sudo timedatectl set-time "2017-05-30 18:17:16"

make sure your timezone is correct too, e.g:

sudo timedatectl set-timezone Europe/Paris

and also use UTC if you are using localtime:

sudo timedatectl set-local-rtc 0
| improve this answer | |
  • the sudo timedatectl set-ntp 0 helps me – Ryan Arief Jun 24 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.