I am trying to determine how Ubuntu 18.04 determines how to set the system clock for a computer that has a broken RTC clock (and battery removed) and no access an NTP server and systemd-timesyncd disabled. Upon the boot the time is always 2018-01-28 10:58:48 EST. This appears very similar to

Prevent clock from advancing to a system time after Ubuntu Server build time

Where the time is reported as 2018-01-28 15:58. The only advice he got was to turn off timesyncd, which I already have disabled and also didn't solve his problem.

Normally, an application starts, gets a GPS signal, sets the clock and starts running. But it doesn't really need GPS to run. What it does need is for the clock to not go backwards in time. I thought I might be able to fix that if I knew how Ubuntu decides to set the time to 2018-01-28 10:58:48 EST.

One thing I did try was to enable systemd-timesyncd. While the computer isn't normally connected to the Internet, as a maintenance procedure, I may connect it. Then I get the correct time and it touch(es) a file at /var/lib/private/systemd/timesync/clock. If I disconnect from the Internet and manually touch the file, the next boot will use that time. But even that approach, while better, still can set the clock backwards as it effectively remembers the last time the computer was connected to the Internet.

That aside, it seems a mystery that Ubuntu would use the same time at boot if it can't determine a time and that time isn't something like Jan 1 of some year. If I knew what Linux was doing, I might be able to craft a solution. So far, except for the URL above, what I find is a lot of "how to use NTP" and "Using NTP is a good idea" etc. I would if I could but no Internet except in maintenance mode.


Since you removed the battery needed for the RTC to function, it uses whatever's in the BIOS/firmware when plugged into the wall, and most (but not all) start counting at 1980-01-01 12:00:01 AM when connected to mains power. Most will run somewhat accurately, but inaccurate enough that people came up with NTP to make it really accurate.

Yours has an executable, somewhere, which sets it to start at 2018-01-28 10:58:48 EST.

Most PCs do not have GPS capability, and instead use NTP. Tablets and phones do have A-GPS which has a GPS-band receiver, but rarely do desktops and servers have that; some laptops do.

| improve this answer | |
  • thanks for the effort but your reply doesn't answer the question of which Ubuntu program is setting the date to 2018-01-28. I'll understand if nobody knows. Other notes -- the GPS almost always works. I'm only trying to address the problem for those few times the GPS isn't working. The RTC is broken because we intentionally removed the battery. – Hugh McCurdy Sep 16 '19 at 17:39

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.