How to tell Ubuntu that hardware clock is local time?

41,456

In Ubuntu releases that use systemd the command to change time to local and update the clock right away is

timedatectl set-local-rtc 1 --adjust-system-clock

If you run timedatectl, it will show with a warning

               Local time: ...
           Universal time: ... 
                 RTC time: ...     
                Time zone: ...
System clock synchronized: yes                         
              NTP service: active                      
          RTC in local TZ: yes  

Warning: The system is configured to read the RTC time in the local time zone.
         This mode can not be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.

This warning doesn't mean that it is set to 0. If it was set to 0, timedatectl status says:

RTC in local TZ: no

and there is no Warning.

RTC in local TZ: yes

is preferred, if you're dual booting. The suggested command is for switching RTC back to "no".

Share:
41,456

Related videos on Youtube

Dims
Author by

Dims

Updated on September 18, 2022

Comments

  • Dims
    Dims almost 2 years

    How to tell Ubuntu that hardware clock is local time?

    This command didn't help:

    timedatectl set-local-rtc 1
    
    • Pilot6
      Pilot6 almost 7 years
      This is the correct command, but it doesn't work immidiately. Run it as timedatectl set-local-rtc 1 --adjust-system-clock.
  • Michael
    Michael almost 7 years
    I tried that, but seems not working, when I tried 'timedatectl | grep local', it said ** RTC in local TZ: yes Warning: The system is configured to read the RTC time in the local time zone. 'timedatectl set-local-rtc 0'.**
  • Michael
    Michael almost 7 years
    So it seems Ubuntu is already using local time, but after using your instruction on a terminal, it still showed timedatectl set-local-rtc 0, what I'm doing wrong?
  • Pilot6
    Pilot6 almost 7 years
    You are not doing anything wrong. There is a warning that in some cases it is better to use RTC and suggests how to change it. Why don't you red the whole warning? It is quite clear.
  • Michael
    Michael almost 7 years
    The warning said: "Warning: The system is configured to read the RTC time in the local time zone. 'timedatectl set-local-rtc 0'.", so I'm assuming it's already using local time, but why it showed 0? I've tried to change RTC file, and there's no entry with UTC=, can I just add it?
  • Pilot6
    Pilot6 almost 7 years
    It is not "showing 0", it suggests to run 'timedatectl set-local-rtc 0 to switch it back to RTC. It says "use RTC in UTC by calling 'timedatectl set-local-rtc 0'" It doesn't say that it is set to 0.
  • Pilot6
    Pilot6 almost 7 years
    If it is still not clear, you can ask a new question.
  • Michael
    Michael almost 7 years
    Thanks Pilot6, you're correct, after issuing the command, windows is giving me the right time now, thanks for your feedback and being patient with my questions.
  • Andor Kiss
    Andor Kiss over 3 years
    This whole issue arises (usually) for people who either dual boot (after a Windows installation), or are using a computer that used to have windows and now they have installed (Linux) Ubuntu. The issue is that all UNIX based systems use UTC (GMT) as the time setting in the BIOS; but if the BIOS time setting (usually listed as "LOCAL TIME AND DATE") is set as local time & date you will have a problem with *NIX systems. UNIX systems use the BIOS time (UTC and/or RTC (CMOS)) as a reference point and then the O/S adjusts the time depending on your TZ.