-1

After i synced the windows time my hardware clock time is bad.

timedatectl 
               Local time: Sun 2023-10-01 15:38:05 CEST
           Universal time: Sun 2023-10-01 13:38:05 UTC
                 RTC time: Sun 2023-10-01 13:38:05
                Time zone: Europe/Budapest (CEST, +0200)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no
sudo hwclock 
2023-10-01 15:38:47.644031+02:00

The UTC and the RTC time are right, timezone is right, but the CEST time is wrong. What can I do in this situation?

1 Answer 1

1

The UTC and the RTC time are right, timezone is right, but the CEST time is wrong.

No!* The UTC time and the RTC times are wrong. I mean, it's not 13:38 now in UTC, at all, it's 11:38.

So, that's the thing: your Linux thinks your RTC is set to UTC time (which, honestly, is the sanest thing to do) but it's set to your local time.

     RTC in local TZ: no

should be yes, if you actually plan to keep your RTC in a local time zone (I'd advise against that, because suddenly your RTC needs to be adjusted twice a year for daylight savings time, and if you travel with a laptop, what even is local time zone? How should the RTC know where you currently are? Why should it care?)

Windows does support using UTC as RTC time, so that's what I would do. However, Windows' own NTP time synchronization will overwrite the RTC with the wrong (local) time (instead of keeping it in UTC), so you'd need to disable the time sync under windows.

If you can't do that, your other option is to let your Linux system know that the RTC is in your local time zone, not in UTC, by running timedatectl set-local-rtc 1. Again, the downside is that inherently, your RTC, whose job would really be to just keep track of "absolute" time, will have to make jumps when there's daylights saving time starting or ending, or when you walk into a different time zone.

Anecdote time: Assuming "Europe/Budapest" means you're in Hungary: I've been on vacation in Hungary nearly two decades ago, when I nearly walked into a different time zone, just to get pointed out that maybe I should stay away from that border without proper papers. It happens to the best of us; I do go to conferences that are typically in different time zones annually, typically (epidemics might have influenced that frequency lately).

2
  • "However, Windows' own NTP time synchronization will overwrite the RTC with the wrong (local) time (instead of keeping it in UTC), so you'd need to disable the time sync under windows." Do you have a link to any details about that bug? Commented Oct 2, 2023 at 3:28
  • @JosephSible-ReinstateMonica superuser.com/questions/975717/… first I could find. Commented Oct 2, 2023 at 6:35

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.