How to sync time on Mint 19.3?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Mushin
Level 1
Level 1
Posts: 19
Joined: Mon May 11, 2020 5:26 am

How to sync time on Mint 19.3?

Post by Mushin »

The reason my clock is out of sync is that I had to boot from a windows 10 stick.
I have tried searching the web but I had no luck or did not stumble upon a correct solution.
Everything I tried seems to be out of date or not specific to Linux Mint 19.3.
What is the current way to force a time sync on Mint 19.3?

The lack of a sync time button in the date and time preferences is really annoying! Enabling the option should do a sync immediately. But no...
I don't want to use my local time as system time to make Windows happy I just want to enable and force time sync on demand.

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
mikeflan
Level 16
Level 16
Posts: 6912
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: How to sync time on Mint 19.3?

Post by mikeflan »

Click on time in the lower right (right side of task bar) - select "Date and time Settings" and turn on Network time.
time.png
I don't do that, but maybe it will work for you.
Mushin
Level 1
Level 1
Posts: 19
Joined: Mon May 11, 2020 5:26 am

Re: How to sync time on Mint 19.3?

Post by Mushin »

mikeflan wrote: Sun May 15, 2022 9:08 am Click on time in the lower right (right side of task bar) - select "Date and time Settings" and turn on Network time.
Unfortunately that does not work for some reason.
The time does not change even after reboot.
iliketrains
Level 4
Level 4
Posts: 241
Joined: Wed Aug 26, 2020 6:32 pm

Re: How to sync time on Mint 19.3?

Post by iliketrains »

Mushin wrote: Sun May 15, 2022 6:34 am The reason my clock is out of sync is that I had to boot from a windows 10 stick.
I have tried searching the web but I had no luck or did not stumble upon a correct solution.
Then you have seen mention of local time, universal time, and real time (hardware clock). Confusing stuff isn't it ?

Code: Select all

timedatectl
Will show what Mint's seeing.
What is the current way to force a time sync on Mint 19.3?
Sync every boot sounds like a nuisance. Better would be setting Mint and Windows to match. I'm not sure which OS is better to change. I'll be back if nobody offers an opinion on those 2 options.

edit (much later)/ Sorry I'm bailing out. Don't know what's changed since 19.3 and will not offer commands I can't fully test.
mikeflan
Level 16
Level 16
Posts: 6912
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: How to sync time on Mint 19.3?

Post by mikeflan »

MAlfare

Re: How to sync time on Mint 19.3?

Post by MAlfare »

mikeflan wrote: Sun May 15, 2022 7:28 pm You can try this if you want to:
https://www.golinuxhub.com/2017/12/how- ... -and-time/
Does anybody still use ntp?
djph
Level 7
Level 7
Posts: 1869
Joined: Thu Jun 27, 2019 5:43 am
Location: ::1

Re: How to sync time on Mint 19.3?

Post by djph »

MAlfare wrote: Mon May 16, 2022 8:59 am
mikeflan wrote: Sun May 15, 2022 7:28 pm You can try this if you want to:
https://www.golinuxhub.com/2017/12/how- ... -and-time/
Does anybody still use ntp?
Everybody.


iliketrains wrote: Sun May 15, 2022 11:41 am Sync every boot sounds like a nuisance. Better would be setting Mint and Windows to match. I'm not sure which OS is better to change. I'll be back if nobody offers an opinion on those 2 options.
The root cause is typically due to Windows expects the BIOS clock is in localtime, whereas Linux expects it to be UTC. The reason one cannot just sync on linux boot then is because the time is too far off (an hour or more, unless you live in an area where localtime IS UTC/GMT).

Easiest fix is to tell linux that the hwclock is in localtime -- timedatectl set-local-rtc 1 --adjust-system-clock.
iliketrains
Level 4
Level 4
Posts: 241
Joined: Wed Aug 26, 2020 6:32 pm

Re: How to sync time on Mint 19.3?

Post by iliketrains »

MAlfare wrote: Mon May 16, 2022 8:59 am Does anybody still use ntp?

Code: Select all

timedatectl

Code: Select all

NTP service: n/a
but

Code: Select all

systemctl status ntp

Code: Select all

ntp.service - Network Time Service
Active: active (running) since Sun 2022-05-15 15:55:58 CDT; 20h ago
It's like one hand doesn't know what the other is doing sort of thing. Shrugs.

Tip of the day: Don't install an OS when the bios battery is dead. I made that mistake the day before this topic was posted.
MAlfare

Re: How to sync time on Mint 19.3?

Post by MAlfare »

djph wrote: Mon May 16, 2022 11:02 am
MAlfare wrote: Mon May 16, 2022 8:59 am
mikeflan wrote: Sun May 15, 2022 7:28 pm You can try this if you want to:
https://www.golinuxhub.com/2017/12/how- ... -and-time/
Does anybody still use ntp?
Everybody.
The ntp protocol of course, but not the ntp daemon and his tools .
Mushin
Level 1
Level 1
Posts: 19
Joined: Mon May 11, 2020 5:26 am

Re: How to sync time on Mint 19.3?

Post by Mushin »

Sorry I did not reply sooner, I was busy.

Code: Select all

$ timedatectl status
                      Local time: Tue 2022-05-17 10:08:38 CEST
                  Universal time: Tue 2022-05-17 08:08:38 UTC
                        RTC time: Tue 2022-05-17 08:08:38
                       Time zone: Europe/Zagreb (CEST, +0200)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
$ systemctl status ntp
Unit ntp.service could not be found.
$ /etc/init.d/ntp ntptimeset
bash: /etc/init.d/ntp: No such file or directory
$ 

I'd like to simply force the update. But there seems to be a problem with time sync on my system It does not work automatically, even after several days now it did not update even once. The reason I prefer to force it instead of syncing windows and Linux is because Linux complains if HW clock is set to local time, windows might break if clock is set to UTC. Lets just appreciate for a moment how stupid Windows is... Setting the HW clock to UTC is the only logical choice.
Mushin
Level 1
Level 1
Posts: 19
Joined: Mon May 11, 2020 5:26 am

Re: How to sync time on Mint 19.3?

Post by Mushin »

I tired to update and none of the repositories would load.
Looks like setting up a static IP and changing the DNS servers to cloudflare was the problem.
This also affected NTP time sync somehow.
I have reset the network connection settings to default and set it to Automatic DHCP. Also I have enabled IPv6.
Now everything works! :D

If anyone can explain it would be great to know why and how to avoid this problem when using alternate DNS.
djph
Level 7
Level 7
Posts: 1869
Joined: Thu Jun 27, 2019 5:43 am
Location: ::1

Re: How to sync time on Mint 19.3?

Post by djph »

Mushin wrote: Tue May 17, 2022 5:25 am I tired to update and none of the repositories would load.
Looks like setting up a static IP and changing the DNS servers to cloudflare was the problem.
This also affected NTP time sync somehow.
I have reset the network connection settings to default and set it to Automatic DHCP. Also I have enabled IPv6.
Now everything works! :D

If anyone can explain it would be great to know why and how to avoid this problem when using alternate DNS.
There typically is no problem with using alternative DNS services. "Static IP" may certainly be problematic if you selected an IP address in the range of your DHCP server and caused an IP conflict.
Mushin
Level 1
Level 1
Posts: 19
Joined: Mon May 11, 2020 5:26 am

Re: How to sync time on Mint 19.3?

Post by Mushin »

djph wrote: Tue May 17, 2022 5:32 am
Mushin wrote: Tue May 17, 2022 5:25 am I tired to update and none of the repositories would load.
Looks like setting up a static IP and changing the DNS servers to cloudflare was the problem.
This also affected NTP time sync somehow.
I have reset the network connection settings to default and set it to Automatic DHCP. Also I have enabled IPv6.
Now everything works! :D

If anyone can explain it would be great to know why and how to avoid this problem when using alternate DNS.
There typically is no problem with using alternative DNS services. "Static IP" may certainly be problematic if you selected an IP address in the range of your DHCP server and caused an IP conflict.
Thanks for the explanation that should be it!
system clock syncronized is now: yes.
The two commands below still dont work.
I guess Mint 19.3 does not use those programs to sync time?

Code: Select all

$ timedatectl status
                      Local time: Tue 2022-05-17 10:08:38 CEST
                  Universal time: Tue 2022-05-17 08:08:38 UTC
                        RTC time: Tue 2022-05-17 08:08:38
                       Time zone: Europe/Zagreb (CEST, +0200)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
$ systemctl status ntp
Unit ntp.service could not be found.
$ /etc/init.d/ntp ntptimeset
bash: /etc/init.d/ntp: No such file or directory
$ 
djph
Level 7
Level 7
Posts: 1869
Joined: Thu Jun 27, 2019 5:43 am
Location: ::1

Re: How to sync time on Mint 19.3?

Post by djph »

yeh, seems that timedatectl superseded ntp nowadays ... at least in Ubuntu/Mint by default anyway.
MAlfare

Re: How to sync time on Mint 19.3?

Post by MAlfare »

Mushin wrote: Tue May 17, 2022 5:43 am
Thanks for the explanation that should be it!
system clock syncronized is now: yes.
The two commands below still dont work.
I guess Mint 19.3 does not use those programs to sync time?

Code: Select all

$ timedatectl status
                      Local time: Tue 2022-05-17 10:08:38 CEST
                  Universal time: Tue 2022-05-17 08:08:38 UTC
                        RTC time: Tue 2022-05-17 08:08:38
                       Time zone: Europe/Zagreb (CEST, +0200)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
$ systemctl status ntp
Unit ntp.service could not be found.
$ /etc/init.d/ntp ntptimeset
bash: /etc/init.d/ntp: No such file or directory
$ 
The ntp disables working of systemd-timesyncd an maybe timedatectl too.
So it is good when this package is not installed.
Last edited by MAlfare on Tue May 17, 2022 6:27 pm, edited 1 time in total.
User avatar
Night Wing
Level 4
Level 4
Posts: 472
Joined: Wed Dec 25, 2013 10:21 pm
Location: Piney Woods of Southeast Texas

Re: How to sync time on Mint 19.3?

Post by Night Wing »

When I use to dual boot Linux Mint and Windows 7, because both of my two desktop tower computers have three hard drive bays in them and each bay had a working hard drive in each slot, the time was never the same for both. So I made an adjustment in Windows 7 to make the time the same for both Linux Mint and Windows 7.

I used "Make Windows Use UTC Time By Editing the Registry" in the link below. It is about half way down the page.

https://www.howtogeek.com/323390/how-to ... l-booting/

BTW, this also worked for Windows 10. I can't vouch this will work for Windows 11 because I have never tried it on a Windows 11 computer for a dual boot.
Linux Mint 21.3 (Virginia) Xfce
MX Linux 23.2 (Libretto) Xfce
Linux Debian 12.5 (Bookworm) Xfce
Mushin
Level 1
Level 1
Posts: 19
Joined: Mon May 11, 2020 5:26 am

Re: How to sync time on Mint 19.3?

Post by Mushin »

Night Wing wrote: Tue May 17, 2022 6:38 am When I use to dual boot Linux Mint and Windows 7, because both of my two desktop tower computers have three hard drive bays in them and each bay had a working hard drive in each slot, the time was never the same for both. So I made an adjustment in Windows 7 to make the time the same for both Linux Mint and Windows 7.

I used "Make Windows Use UTC Time By Editing the Registry" in the link below. It is about half way down the page.

https://www.howtogeek.com/323390/how-to ... l-booting/

BTW, this also worked for Windows 10. I can't vouch this will work for Windows 11 because I have never tried it on a Windows 11 computer for a dual boot.
I'l try that, I dont have a lot of applications on the usb stick it's just for specific stuff that wont work on Linux. So it probably wont break anything critical in windows.
Thanks :)
Locked

Return to “Software & Applications”