Ubuntu keeps displaying UTC time despite setting timezone

7,119

Solution 1

You need to reconfigure timezone data.

sudo dpkg-reconfigure tzdata

Solution 2

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

Share:
7,119

Related videos on Youtube

wheeler
Author by

wheeler

Updated on September 18, 2022

Comments

  • wheeler
    wheeler over 1 year

    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?

    • Joshua Besneatte
      Joshua Besneatte over 5 years
      have you tried setting your timezone from the settings gui?
    • wheeler
      wheeler over 5 years
      Yes, but it had no effect.
    • abu-ahmed al-khatiri
      abu-ahmed al-khatiri over 5 years
      i think you forgot to add a argument --adjust-system-clock
  • 24601
    24601 over 5 years
    @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.
  • wheeler
    wheeler over 5 years
    The system clock is not in local time, as noted by the screenshot of timedatectl.
  • wheeler
    wheeler over 5 years
    Performing the steps you have outlined had no effect.
  • wheeler
    wheeler over 5 years
    Running sudo timedatectl set-local-rtc 1 --adjust-system-clock yields Failed to set local RTC: Access denied.
  • abu-ahmed al-khatiri
    abu-ahmed al-khatiri over 5 years
    @wheeler as mentions the output of your command timedatectl, you get : Access denied couse not yet activated your RTC, did you try my answered?
  • wheeler
    wheeler over 5 years
    Your answer is not clear. I tried disabling NTP with the first command, and then ran timedatectl set-local-rtc ...
  • wheeler
    wheeler over 5 years
    Holy frick that did it. I am going to run through the same steps to ensure that solved the problem.
  • dataviews
    dataviews about 4 years
    confirmed this worked for me on AWS ec2 ubuntu distribution. thank you :)