For some odd reason, whenever I come home (16:00), the clock is set 8 hours ahead (0:00, date jumps to the next day). I have to set my clock manually every time or restart my computer to get the correct time again. There isn’t any weird time zone shenanigans, the automatic time zone is still correct, and I don’t live somewhere with daylight savings. What’s wrong with my clock???

I am using Fedora 43 KDE (note: the issue was a thing in 42 KDE as well, but not with 42 Workstation. Either this is a KDE bug or there is some weird conflict with the remnants of gnome stuff. Or maybe I borked something I shouldn’t have, idk)

edit: It is time zone shenanigans! My timezone is GMT+8. I have ran “timedatectl set-local-rtc 0” (the warning mentioned this when I ran “timedatectl status” as one person said to do) so let’s see if that fixes it

  • BananaTrifleViolin@lemmy.world
    link
    fedilink
    English
    arrow-up
    28
    ·
    edit-2
    1 day ago

    It sounds like your system clock may be the issue.You have a system clock inside your device. Linux usually uses the internet to set your clock but still refers to your system clock. If the internet provided time is too far off your system clock it may ignore it and display your system time.

    KDE respects the NTP clock settings used by your linux system, while ironically Gnome does not and does its own thing directly with the time date control. This is probably why you’re now noticing a problem.

    So either your system clock is supposed to be UTC and actually set to local time, or your system clock is correct but your timezone in linux is way off.

    If you use timedatectl status in a terminal it’ll show your current local time, UTC and RTC time, as well as your timezone and whether the RTC is set to your local timezone or UTC. RTC is your hardware clock on your device.

    If “RTC is local tz” says no, then the value for RTC and UTC should be the same, as your hardware clock is set to be the UTC time. And if the UTC time is wrong then your system is uaing your hardware clock to incorrectly work out the UTC. UTC is the 0 timezone worldwide and has an absolute value - its the same for everyone and you can esily.find it with a search engine. If the displayed UTC is wrong on your system, then you’re out of sync with everyone.

    So how to fix it if its wrong:

    One way would be to tell your systen what the hardware clock should be and then set it correct. Use “timedatectl set-local-rtc 1” to make it set to be in your local time zone. Or if you want it to be UTC you can use timedatectl set-local-rtc 0. You can use either but UTC is better.

    That should fix the issue as the network time will now come in correctly.

    But if you wanted you can also manually set the local time and date with timedatectl set-time hh:mm:ss. Once that is set then your RTC should also be changed and be back in sync depending on whether you set it up to be also local or UTC. When you set the local tine it will work out the UTC value based on your timezone. Note if the timezone is wrong it’ll still be wrong!

    If you can’t set the time because NTP (network time) is running, you could.leave it and the clock should now sort itself out. But if you want to force mannually set the time you can turn off NTP if you want: “timedatctl set-ntp false” You could leave it off and set the time manually using “timedatectl set-time hh:mm:ss”

    If still getting NTP error messagss you could also disable the NTP system job temporarily: systemctl disable --now chronyd. Turn it back on afterwards with systemctl enable --now chronyd

    Finally do make sure the timezone is correct. I know you say it is but timedatectl shows you what the system thinks it is, and if ita wrong then rtc/utc will still be wrong as the timezone is used to convert from local time to UTC. You can use timedatectl to change the timezone: timedatectl set-timezone name.

    There are loads of valid timezones but only valid ones will work. Get your local timezones official name online or use timedatectl list-timezones to see all the options. You can filter uaing egrep etc.

    Hopefully that’ll fix the issue for you. You can also boot into your bios and manually set the hardware clock if needs be but linux still needs to know whether its supposed to be utc ir local time.