Jump to content
sathish

How to change time through commands?

Recommended Posts

Hi, I tried to change time using (sudo date -set='2020-01-22 19:57:00' ) command after active/inactive the ntp through (timedatectl set-ntp no). But after reboot given time/date not reflected, it will be on current time automatically. In raspberry pi first I will set ntp inactivate after that I will use date command to change time. But in asus tinker board its not reflecting.

Share this post


Link to post
Share on other sites

hello @sathish

if you'd like to change it permantly, you can use systemd-timesync only and remove ntp

enable systemd-service first:

sudo systemctl enable systemd-timesyncd.service

remove disable-with-time-daemon.conf as it's causing dependency conflict:

rm /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf

disable/ stop ntp:

sudo systemctl stop ntp
sudo systemctl disable ntp

you can check the result with

timedatectl

 

reference: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1800695.html

 

Share this post


Link to post
Share on other sites
2 hours ago, tooz said:

hello @sathish

if you'd like to change it permantly, you can use systemd-timesync only and remove ntp

enable systemd-service first:


sudo systemctl enable systemd-timesyncd.service

remove disable-with-time-daemon.conf as it's causing dependency conflict:


rm /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf

disable/ stop ntp:


sudo systemctl stop ntp
sudo systemctl disable ntp

you can check the result with


timedatectl

 

reference: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1800695.html

 

HI Tooz thanks for your suggestion, But I am not planning for permanent time change.

I want to  change the time/date whenever I want or whenever time/date wrong.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...