7

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?

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

4 Answers 4

10
+50

You need to reconfigure timezone data.

sudo dpkg-reconfigure tzdata
2
  • 1
    Holy frick that did it. I am going to run through the same steps to ensure that solved the problem.
    – wheeler
    Nov 28, 2018 at 18:49
  • confirmed this worked for me on AWS ec2 ubuntu distribution. thank you :)
    – dataviews
    Apr 15, 2020 at 0:09
1

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

2
  • @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, 2018 at 15:47
  • Performing the steps you have outlined had no effect.
    – wheeler
    Nov 27, 2018 at 14:23
0

Command: To set to local time

timedatectl set-local-rtc 1

To check:

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

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.

3
  • Running sudo timedatectl set-local-rtc 1 --adjust-system-clock yields Failed to set local RTC: Access denied.
    – wheeler
    Nov 27, 2018 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? Nov 28, 2018 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, 2018 at 18:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .