Something appears to be broken with regards to how Unity displays the system time in the current time zone. I am running an Ubuntu 16.04 guest in VirtualBox, on a Windows 10 host. I have changed the timezone by linking /etc/localtime to /usr/share/zoneinfo/America/New_York (because sudo timedatectl set-timezone America/New_York didn't do anything). When I execute timedatectl, it reports the proper time and timezone:

$ timedatectl
      Local time: Mon 2018-11-12 10:54:13 EST
  Universal time: Mon 2018-11-12 15:54:13 UTC
        RTC time: Mon 2018-11-12 15:54:12
       Time zone: America/New_York (EST, -0500)
 Network time on: yes
NTP synchronized: no
 RTC in local TZ: no

However, for whatever reason, Unity is still incorrectly reporting the time in UTC time, even after rebooting the VM:

enter image description here

How do I get Unity to properly display the time in the local timezone?

  • have you tried setting your timezone from the settings gui? – Joshua Besneatte Nov 12 '18 at 16:09
  • Yes, but it had no effect. – wheeler Nov 27 '18 at 14:24
  • i think you forgot to add a argument --adjust-system-clock – abu-ahmed al-khatiri Nov 27 '18 at 15:19

You need to reconfigure timezone data.

sudo dpkg-reconfigure tzdata
  • Holy frick that did it. I am going to run through the same steps to ensure that solved the problem. – wheeler Nov 28 '18 at 18:49

Go to System Settings > Time % Date and set your location (in my case Paris)

enter image description here

The select the Clock tab and check both Time in auto-detected and Time in other locations. Then select Choose Location and add in (say) UTC or any other location you may require.

enter image description here

Then you will be able to select the time and date on the top bar with left clock of the mouse and select which time you wish to have displayed.

enter image description here

  • @wheeler If this answer solved the issue for you, perhaps you might be kind enough to mark it off as the best answer which will aid other users with similar issues. Thankyou. – Graham Nov 13 '18 at 15:47
  • Performing the steps you have outlined had no effect. – wheeler Nov 27 '18 at 14:23

Command: To set to local time

timedatectl set-local-rtc 1

To check:

timedatectl | grep local
  • The system clock is not in local time, as noted by the screenshot of timedatectl. – wheeler Nov 27 '18 at 14:22

The problem's you are using a NTP to synchronized your time/data. disable it with following

sudo update-rc.d -f ntp remove

and activated again your systemd-timesyncd.service like your question previously.

and do a alternative from the following material this. set your UTC with following command on your Ubuntu 16.04 Guest

VBoxManage setextradata "your-VM-name" "VBoxInternal/Devices/VMMDev/0/Config/UseUTC" 1

Finally, restart your VB again!!

Hope this helps.

  • Running sudo timedatectl set-local-rtc 1 --adjust-system-clock yields Failed to set local RTC: Access denied. – wheeler Nov 27 '18 at 16:43
  • @wheeler as mentions the output of your command timedatectl, you get : Access denied couse not yet activated your RTC, did you try my answered? – abu-ahmed al-khatiri Nov 28 '18 at 9:27
  • Your answer is not clear. I tried disabling NTP with the first command, and then ran timedatectl set-local-rtc ... – wheeler Nov 28 '18 at 18:46

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.