3

I am running Ubuntu 18.04.3 and changes I make to the timezone do not persist. That is, I make the change and at some point within 5-20 minutes, the clock reverts to UTC time.

I have updated the timezone using the GUI and also via the command line:

sudo timedatectl set-timezone "Pacific/Auckland"
sudo dpkg-reconfigure -f noninteractive tzdata

I've also played around with the "Automatic Date/Time" and "Automatic Timezone" settings and it doesn't make any difference whether they're on or off.

I can't find a report for anything similar when searching for this issue online.

Any suggestions for how to investigate or fix this would be appreciated.

EdK
  • 33
  • 3
  • Do you have [location services](https://help.ubuntu.com/stable/ubuntu-help/privacy-location.html.en) disabled? – mchid Oct 21 '19 at 00:13
  • Also, is your computer "dual boot"? – mchid Oct 21 '19 at 00:14
  • Location services was disabled. I turned it on, reset the timezone and again it reverted after about 10 minutes. – EdK Oct 21 '19 at 23:22
  • Computer is not dual boot, just a Ubuntu installation – EdK Oct 21 '19 at 23:22
  • Having location services on can sometimes interfere with your settings. Dual boot can also mess with the time. Have you checked your BIOS to see what time zone is set in BIOS? – mchid Oct 21 '19 at 23:27
  • BIOS time is set to UTC – EdK Oct 22 '19 at 21:30
  • If UTC is not your time zone, set your BIOS to the proper time zone to see if the problem persists. Please let me know if this works and I will post it as an answer. – mchid Oct 22 '19 at 21:43
  • I appreciate you taking the time to help me with this, but: are you sure? From everything I've read on all the forums I've searched to try to find an answer to this issue, you're supposed to keep your BIOS at UTC and change your local timezone. This seems like a bit of a sledgehammer solution that incurs its own problems... I'm ideally looking for a way to debug and fix whatever it is that's causing the timezone to reset. – EdK Oct 23 '19 at 21:00
  • You are right. It looks like this is only a problem when you are [running both Windows and Ubuntu](https://superuser.com/a/697485). However, if you run the command: `timedatectl` and it should say `RTC in local TZ: no`. If it says `RTC in local TZ: yes` then you need to run: `sudo timedatectl set-local-rtc 0 --adjust-system-clock` [to tell Ubuntu that the BIOS is set to UTC](https://askubuntu.com/a/946520/167115). – mchid Oct 23 '19 at 23:00
  • [This answer](https://askubuntu.com/questions/728590/how-to-check-if-hardware-clock-is-in-utc-or-local-time) explains the setting. – mchid Oct 23 '19 at 23:18
  • 1
    Yep, I'd seen all of that and decided it wasn't relevant to my specific problem. Turns out that it seems to have resolved, now, though can't particularly understand why. But thanks for your efforts. – EdK Oct 24 '19 at 03:55

2 Answers2

1

According to this article:

You don't need the sudo dpkg-reconfigure -f noninteractive tzdata command and it makes me wonder if it harms things.

Basically just use:

$ timedatectl # lists your current time zone

$ sudo timedatectl set-timezone "Pacific/Auckland"

$ timedatectl # lists your new time zone

If time zone reverts back to UTC, use this command:

sudo dpkg-reconfigure tzdata
WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401
  • I have tried just the timedatectl method but this only lasts for a few minutes, as described. I found somewhere the dpkg-reconfigure instruction which I understood somehow forced the changes into the system but this makes no difference – EdK Oct 21 '19 at 23:25
  • @EdK According to the link, when you type `ls -l /etc/localtime` is the symbolic link to the correct time zone? – WinEunuuchs2Unix Oct 21 '19 at 23:30
  • It shows the current clock timezone. So Pacific/Auckland for the 5-20 minutes that the change persists, but then reverts to Europe/London. – EdK Oct 22 '19 at 20:51
  • I'll try to figure out the process changing the symbolic link. – WinEunuuchs2Unix Oct 22 '19 at 21:37
  • Similar to what you tried before, can you try `sudo dpkg-reconfigure tzdata ` with no other options. – WinEunuuchs2Unix Oct 22 '19 at 21:45
  • OK that seems to have worked. Don't understand why as I'm 90% sure I tried that ages ago without success. Anyway, thanks, I guess! Not sure how to mark a comment as the solution, though? – EdK Oct 24 '19 at 03:54
0

Can try using the command below to disable the automatic-timezone change

gsettings set org.gnome.desktop.datetime automatic-timezone false
Debo
  • 1