How to force Linux to update the time ?

Deadjasper

[H]ard|Gawd
Joined
Oct 28, 2001
Messages
1,917
I've done my homework and jumped through all the hoops. I've run the following and get no errors but the time does not update. :(

sudo service ntp stop
sudo ntpdate -s time.nist.gov
sudo service ntp start

Any help much appreciated.
 

KarsusTG

2[H]4U
Joined
Aug 27, 2010
Messages
3,231
What distro? Is ntpdate.service enabled in systemctl? Is SYNC_HWCLOCK set to yes in ntpdate?
 

Deadjasper

[H]ard|Gawd
Joined
Oct 28, 2001
Messages
1,917
Sorry, Linux Mint Cinnomin 19. I'll check brb.

CMOS battery is fine. Clock date is correct. time is off by 5 minutes.
 

Deadjasper

[H]ard|Gawd
Joined
Oct 28, 2001
Messages
1,917
I installed ntpdate and it appears not to be running. When I try to start it I get an ntpdate.service not found.
 

KarsusTG

2[H]4U
Joined
Aug 27, 2010
Messages
3,231
When you do a systemctl status ntp.service does it show active? I ask, because I think mint 19 is based off ubuntu 18.04 and I had a similar error on a friends computer. You might have to disable systemd-timesyncd.service

Eitherway, I think the error is between these two.
 

Mazzspeed

2[H]4U
Joined
Dec 27, 2017
Messages
2,880
The issue can't be related to 18.04 as I have no such problems here.

5 mins is a pretty small variance, are you sure the clock you're using as reference is actually correct?
 

Deadjasper

[H]ard|Gawd
Joined
Oct 28, 2001
Messages
1,917
I agree, it is a small variance but it bothers me none the less. Checked against 3 Windows boxes and my cell. ntp and ntpdate were not part of the original install, I had to manually install them. Also, in the Date and Time applet there is a toggle for network time. It was and is set to on.

Guess I'll just manually update the time once a week. I was hoping for a simple solution but nothing is ever simple in Linux. But i can live with it.
 

B00nie

[H]F Junkie
Joined
Nov 1, 2012
Messages
8,988
Since it's Mint I wouldn't be surprised if it had some GUI based gizmo messing with your time settings. Normally just installing ntp keeps the clock nicely in time. You may have an issue like having your network settings interfered by a GUI network setup.
 

Deadjasper

[H]ard|Gawd
Joined
Oct 28, 2001
Messages
1,917
Yea, without an error message of any kind it could be anything. Think I'll just live with it. i wasted 3 hours on it yesterday, that's enough.
 

Mazzspeed

2[H]4U
Joined
Dec 27, 2017
Messages
2,880
I agree, it is a small variance but it bothers me none the less. Checked against 3 Windows boxes and my cell. ntp and ntpdate were not part of the original install, I had to manually install them. Also, in the Date and Time applet there is a toggle for network time. It was and is set to on.

Guess I'll just manually update the time once a week. I was hoping for a simple solution but nothing is ever simple in Linux. But i can live with it.

I wouldn't say nothing is simple in Linux. I install Windows multiple times a week and it can never get ntp right, I have time zones set perfectly and it's always 'at least' an hour out and daylight savings is not set.

I've given up under Windows, I just set the time manually.

Everything's going to appear difficult when you're so used to the OS you've probably used as long as you can remember. It's the lack of familiarization that's difficult, not the actual OS. Linux is simple.
 

auntjemima

Supreme [H]ardness
Joined
Mar 1, 2014
Messages
7,786
I wouldn't say nothing is simple in Linux. I install Windows multiple times a week and it can never get ntp right, I have time zones set perfectly and it's always 'at least' an hour out and daylight savings is not set.

I've given up under Windows, I just set the time manually.

Everything's going to appear difficult when you're so used to the OS you've probably used as long as you can remember. It's the lack of familiarization that's difficult, not the actual OS. Linux is simple.

I swear you guys have some strange windows issues lol.

2 things in this thread irked me.

1) when KarusTG said they had a similiar issue on 19, based on 18.04 (aren't they all based off each other anyway? Lol) and then in comes Mazzspeed to inform them that it can't be the issue because it didn't happen to him. I've run into this mantra a handful of times here. I'll have XX problem and be told it's not possible because the person replying has never had it. On to point two..

2) I quoted for this point. How is it that billions of people all over the world can install windows regularly and not have any time issues, yet in this subforum you guys get every issue every time... To say you install windows multiple times a week and the time is always off tells me you are the issue. I think you guys purposely mess up installs just to use it as examples.
 

Deadjasper

[H]ard|Gawd
Joined
Oct 28, 2001
Messages
1,917
I swear you guys have some strange windows issues lol.

2 things in this thread irked me.

1) when KarusTG said they had a similiar issue on 19, based on 18.04 (aren't they all based off each other anyway? Lol) and then in comes Mazzspeed to inform them that it can't be the issue because it didn't happen to him. I've run into this mantra a handful of times here. I'll have XX problem and be told it's not possible because the person replying has never had it. On to point two..

2) I quoted for this point. How is it that billions of people all over the world can install windows regularly and not have any time issues, yet in this subforum you guys get every issue every time... To say you install windows multiple times a week and the time is always off tells me you are the issue. I think you guys purposely mess up installs just to use it as examples.

Settle down little grasshopper, everything will be OK. :)
 

KarsusTG

2[H]4U
Joined
Aug 27, 2010
Messages
3,231
1) when KarusTG said they had a similiar issue on 19, based on 18.04 (aren't they all based off each other anyway? Lol) and then in comes Mazzspeed to inform them that it can't be the issue because it didn't happen to him. I've run into this mantra a handful of times here. I'll have XX problem and be told it's not possible because the person replying has never had it. On to point two...

Honestly, system installs are to me like fingerprints. They all look the same until you zoom in.

Thanks. ntp.service shows as loaded.

ya, loaded means installed, but active means running. I think you have to disable timesyncd.service to get it to work correctly.
 

ChadD

Supreme [H]ardness
Joined
Feb 8, 2016
Messages
5,152
I swear you guys have some strange windows issues lol.

2 things in this thread irked me.

1) when KarusTG said they had a similiar issue on 19, based on 18.04 (aren't they all based off each other anyway? Lol) and then in comes Mazzspeed to inform them that it can't be the issue because it didn't happen to him. I've run into this mantra a handful of times here. I'll have XX problem and be told it's not possible because the person replying has never had it. On to point two..

2) I quoted for this point. How is it that billions of people all over the world can install windows regularly and not have any time issues, yet in this subforum you guys get every issue every time... To say you install windows multiple times a week and the time is always off tells me you are the issue. I think you guys purposely mess up installs just to use it as examples.

The strange windows issues with time are easy to understand. Yes people ONLY running windows don't notice. The issue is dual booting. Which if a Linux person has a windows install its going to be a dual boot.

https://www.howtogeek.com/323390/ho...ux-showing-different-times-when-dual-booting/

Linux applies UTC time which is the logical way to do it and solves issues such as people flying with their laptops. It also makes life easier for operating systems like Android (and ios which is also UTC) to handle people crossing timezones. Windows assumes the time in the hardware clock is local time.

I don't dual boot that often anymore... but when I do I use regedit and force windows to use UTC, even if I'm turning windows time sync off. MS tends to turn that type of stuff back on now and then. lol

Anyway that is the simple explenation as to why Linux people have issues with Windows time. It stores the time wrong and it overrides the hardware clock if you don't tell it to do anything different. The most annoying thing for me is booting back into Linux and finding the time all messed up (normally out an hour or so) cause Windows has stored a local time to the HW clock.
 

auntjemima

Supreme [H]ardness
Joined
Mar 1, 2014
Messages
7,786
The strange windows issues with time are easy to understand. Yes people ONLY running windows don't notice. The issue is dual booting. Which if a Linux person has a windows install its going to be a dual boot.

https://www.howtogeek.com/323390/ho...ux-showing-different-times-when-dual-booting/

Linux applies UTC time which is the logical way to do it and solves issues such as people flying with their laptops. It also makes life easier for operating systems like Android (and ios which is also UTC) to handle people crossing timezones. Windows assumes the time in the hardware clock is local time.

I don't dual boot that often anymore... but when I do I use regedit and force windows to use UTC, even if I'm turning windows time sync off. MS tends to turn that type of stuff back on now and then. lol

Anyway that is the simple explenation as to why Linux people have issues with Windows time. It stores the time wrong and it overrides the hardware clock if you don't tell it to do anything different. The most annoying thing for me is booting back into Linux and finding the time all messed up (normally out an hour or so) cause Windows has stored a local time to the HW clock.

I guess I just never noticed on my dualboot.
 
  • Like
Reactions: ChadD
like this

ChadD

Supreme [H]ardness
Joined
Feb 8, 2016
Messages
5,152
I've done my homework and jumped through all the hoops. I've run the following and get no errors but the time does not update. :(

sudo service ntp stop
sudo ntpdate -s time.nist.gov
sudo service ntp start

Any help much appreciated.

timedatectl status

Should give you an output from systemd. something like...
Local time: Sat 2019-08-31 13:35:25 CDT
Universal time: Sat 2019-08-31 18:35:25 UTC
RTC time: Sat 2019-08-31 18:35:25
Time zone: America/Winnipeg (CDT, -0500)
System clock synchronized: no
NTP service: active
RTC in local TZ: no

IMO (and keep in mind I don't use Ubuntu or Mint) I would just let systemd take care of time. That would be my solution... but I have no idea if cinimmon would be annoyed or anything. Up to you if you want to try removing ntp. IME systemd does a perfectly fine job and I'm not sure why more distros don't just use systemd its already there.

apt purge ntp
sudo timedatectl set-ntp 1
sudo timedatectl set-local-rtc 0

EDIT doing a bit of reading on Mint. It sounds like Mint 19 switched to using systemd time control, where as 18 used ntp. With 19 though they left all the ntp stuff around and if you upgraded in place I'm sure they would be there. Ya I would just get rid of them and use systemd. Edit if you want to change/add server info /etc/systemd/timesyncd.conf
(I'm on a solus install right now and timesyncd.conf looks like this)
[Time]
#NTP=
#FallbackNTP=time1.google.com time2.google.com time3.google.com time4.google.com
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048
 
Last edited:

ChadD

Supreme [H]ardness
Joined
Feb 8, 2016
Messages
5,152
I guess I just never noticed on my dualboot.

Its only an issue if windows is set to auto update the clock it doesn't mess things up. I don't know if its an issue with every distor... I seem to remember at least one major distro when a windows distro was installed was forcing Linux to use local time. Can't remember which that was though. I just remember vaguely remember setting a dual boot up for someone a few years back and noticing I didn't have to fix the time issue. (I Know I'm getting old I forget little stuff to often lol)
 

Mazzspeed

2[H]4U
Joined
Dec 27, 2017
Messages
2,880
I swear you guys have some strange windows issues lol.

2 things in this thread irked me.

1) when KarusTG said they had a similiar issue on 19, based on 18.04 (aren't they all based off each other anyway? Lol) and then in comes Mazzspeed to inform them that it can't be the issue because it didn't happen to him. I've run into this mantra a handful of times here. I'll have XX problem and be told it's not possible because the person replying has never had it. On to point two..

2) I quoted for this point. How is it that billions of people all over the world can install windows regularly and not have any time issues, yet in this subforum you guys get every issue every time... To say you install windows multiple times a week and the time is always off tells me you are the issue. I think you guys purposely mess up installs just to use it as examples.

You're always so aggressive? It's OK, no operating system's perfect and I'm not going to censor myself in an attempt to protect your fragile state of mind.

If you don't like discussion, don't participate. Nowhere in the rules is it stated that all postings have to conform to auntjemima's judgement of right vs wrong. Quite obviously, as stated by yourself when you claimed "aren't they all based off each other anyway? Lol", the issue as stated by myself isn't an issue across the board regarding 18.04.

Relax. There is nothing wrong with comparisons when talking about PC's in general, I've also never experienced the issue under FreeBSD - Is that OK? I didn't mention Windows, which is the real crux of your problem here. Heaven forbid if Windows wasn't perfect.

Considering the way Windows works out time, it basically isn't perfect.
 

auntjemima

Supreme [H]ardness
Joined
Mar 1, 2014
Messages
7,786
You're always so aggressive? It's OK, no operating system's perfect and I'm not going to censor myself in an attempt to protect your fragile state of mind.

If you don't like discussion, don't participate. Nowhere in the rules is it stated that all postings have to conform to auntjemima's judgement of right vs wrong. Quite obviously, as stated by yourself when you claimed "aren't they all based off each other anyway? Lol", the issue as stated by myself isn't an issue across the board regarding 18.04.

Relax. There is nothing wrong with comparisons when talking about PC's in general, I've also never experienced the issue under FreeBSD - Is that OK? I didn't mention Windows, which is the real crux of your problem here. Heaven forbid if Windows wasn't perfect.

Considering the way Windows works out time, it basically isn't perfect.

My "crux" is as stated. You dismissed the OS being his issue because you don't have it. Your OS has little to do with it.
 

Mazzspeed

2[H]4U
Joined
Dec 27, 2017
Messages
2,880
My "crux" is as stated. You dismissed the OS being his issue because you don't have it. Your OS has little to do with it.

No I didn't.

I stated the issue isn't a problem under every release of 18.04. There's many variants of Ubuntu 18.04 and Mint is but one of them, as always you've flown off the handle and jumped to conclusions.

You really need to control that superiority complex as the aggression really isn't necessary and everyone's entitled to their opinions.
 

auntjemima

Supreme [H]ardness
Joined
Mar 1, 2014
Messages
7,786
No I didn't.

I stated the issue isn't a problem under every release of 18.04. There's many variants of Ubuntu 18.04 and Mint is but one of them, as always you've flown off the handle and jumped to conclusions.

You really need to control that superiority complex as the aggression really isn't necessary and everyone's entitled to their opinions.

I'm sorry your soft shell thinks I am being aggressive.

You specifically stated that...

"The issue can't be related to 18.04 as I have no such problems here. "

So exactly what I stated. You told him the issue cannot be related to his OS version because you do not have the problem.
 

ChadD

Supreme [H]ardness
Joined
Feb 8, 2016
Messages
5,152
cant even get the time to be correct in linux? is this normal? yikes.

Linux time is fine. Windows however does its own thing and if you let it set your HW clock it will write local time not UTC. (which is how EVERY other Operating system with network updated time works).

So if you dual boot ANY operating system with windows. You have to force windows to use UTC when it saves to the HWclock via a registry entry. Or turn windows time update off. (or if your OS allows it you can have it write local time instead)

Long time issue related to windows being stupid.
 
Last edited:

auntjemima

Supreme [H]ardness
Joined
Mar 1, 2014
Messages
7,786
Linux time is fine. Windows however does its own thing and if you let it set your HW clock it will write local time not UTC. (which is how EVERY other Operating system with network updated time works).

So if you dual boot ANY operating system with windows. You have to force windows to use UTC when it saves to the HWclock via a registry entry. Or turn windows time update off. (or if your OS allows it you can have it write local time instead)

Long time issue related to windows being stupid.

I wonder if this is something that's been fixed with new updates. I don't have this on my dual boot, but maybe the reg key is already changed. Have a Google for me to check it out?
 

ChadD

Supreme [H]ardness
Joined
Feb 8, 2016
Messages
5,152
I wonder if this is something that's been fixed with new updates. I don't have this on my dual boot, but maybe the reg key is already changed. Have a Google for me to check it out?

Well if windows is writing UTC time you can check your registry...
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation
The entry that needs to be there is
RealTimeIsUniversal
with a 32 bit value of 1

Under Linux you can run
timedatectl
Which will give you status of your time settings.
One bit of the info would read.
RTC in local TZ: Yes (or no if it's set to the Linux standard)

To force Linux to write to the Real time clock in time zone adjusted time the command is;
timedatectl set-local-rtc 1 --adjust-system-clock

Some distros do have intelligent installers that when they detect a windows dual boot... set linux to use time zone adjustment HWC writes. Its as simple as having the installer run the above command when grub detects MS operating systems. I don't know off hand which distros do that but my money would be that most of the major distros do. Still if you install windows after the fact or something you can run into the issue then anyway of course.
 

Algrim

[H]ard|Gawd
Joined
Jun 1, 2016
Messages
1,712
If the clock time is off by 5 minutes it's probably not related to dual booting changing between local and UTC time. If it were, we'd be looking at time swings in hours, not minutes.
 
  • Like
Reactions: ChadD
like this

ChadD

Supreme [H]ardness
Joined
Feb 8, 2016
Messages
5,152
If the clock time is off by 5 minutes it's probably not related to dual booting changing between local and UTC time. If it were, we'd be looking at time swings in hours, not minutes.

Ya I'm not sure as deadj hasn't said so. But I believe the issue got solved. I am pretty sure it was a case of Mint switching to systemd time and keeping older tools around for compatibility stuff. I assume
https://hardforum.com/threads/how-to-force-linux-to-update-the-time.1986031/#post-1044316344
lead him the right way. The thread has just continued on. :) (I think he solved it anyway)

When distros change basic stuff like that sometimes it's easy to get wrong advice. One thing I hate about some of the bigger distros like Ubuntu/Mint 4 or 5 different versions with tons of easy to google stuff that only ends up applying to a specific often out of date version.
 
Last edited:

Mazzspeed

2[H]4U
Joined
Dec 27, 2017
Messages
2,880
I'm sorry your soft shell thinks I am being aggressive.

You specifically stated that...

"The issue can't be related to 18.04 as I have no such problems here. "

So exactly what I stated. You told him the issue cannot be related to his OS version because you do not have the problem.

I'm not the one getting all bent out of shape, you are. Don't twist this around and make out I'm the snowflake here.

You're exactly right, I stated "The issue can't be related to 18.04" Context: in general. There's more distro's based on 18.04 than Linux Mint, I've stated it more than once, I think Mint is garbage.
 
Top