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

  • Possibly linux@lemmy.zip
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    8 hours ago

    It is probably from time zone auto detection. I had this issue for a while but it went away eventually.

    I think it is tied to WiFi based location detection

    • sbird@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 hours ago

      During the holidays (i.e. I don’t go to school and back) the issue doesn’t pop up. Weird.

  • 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.

  • klangcola@reddthat.com
    link
    fedilink
    arrow-up
    18
    ·
    1 day ago

    Do you happen to dual boot to Windows when at school, and live 8 timezones from Britain? Linux by default stores the hardware clock in UTC (and concerts to local time on the fly), while Windows stores the hardware clock in local time.

    • sbird@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      9
      ·
      1 day ago

      I am using GMT+8, interesting. I don’t dual boot windows at school, but I do have a dual boot with windows (but I rarely ever boot into windows…)

  • Hexarei@beehaw.org
    link
    fedilink
    arrow-up
    1
    ·
    18 hours ago

    Make sure your bios datetime is set correctly to UTC as well. I think the timedatectl command might do that but might not be supported on all systems.

  • edralzar@programming.dev
    link
    fedilink
    arrow-up
    8
    ·
    1 day ago

    Hey, are you SURE this isn’t some timezone shenanigans, but at a lower level ? What is your timezone ? Are you dual booting to Windows sometimes ?

    This could be an issue in how linux uses the hardware’s realtime clock (RTC).

    Perhaps running datetimectl status could provide some insight ?

    • sbird@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      7
      ·
      edit-2
      1 day ago

      a warning shows up: Warning: The system is configured to read the RTC time in the local time zone. This mode cannot 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’.

      The warning disappears when I ran “timedatectl set-local-rtc 0”, will that fix the issue?

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

        Yes it’ll fix the issue. That tells the system that your hardware clock should be in UTC. The time in your hardware clock will then be corrected from the internet as long as your time zone is correct.

      • edralzar@programming.dev
        link
        fedilink
        arrow-up
        4
        ·
        1 day ago

        I’m not an expert but I had a similar problem, except it was visible after each time I was rebooting to windows. Linux by default interprets the hardware clock as UTC, whereas windows interprets as local time. The warning you see is when your linux distro is instead configured to behave like windows does (local time).

        In your case, it doesn’t seem as obvious what is the culprit (no windows to write the local time to the RTC) but perhaps the distro’s update changed that parameter somehow ?

        Setting the flag to 0 shouldn’t cause more trouble than what you’ve already seen I think… So that’s worth trying out for a few days ;)

    • sbird@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      Time zone is GMT+8 (so it is a time zone thing!). Don’t really boot into windows much but it does exist. I think it might be my school’s network

  • just_another_person@lemmy.world
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    1 day ago

    As others have stated, it’s probably because you’re activating the network from an IP that is defined as being in another time zone in between two locations. This can sometimes happen with certain VPN configurations as well.

    Here’s some info on debugging a bit further to help determine if this is the issue: https://www.linuxtechi.com/sync-time-in-linux-server-using-chrony/

    And here’s how to force a time zone if needed: https://www.cyberciti.biz/faq/howto-linux-set-time-zone-per-user-basis/

    • Successful_Try543@feddit.org
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      1 day ago

      Yes, afaIk, the solution is to set some parameter, like HardwareClockIsUTC, in the Windows registry to true. However, OP doesn’t mention running a dual boot machine.