1

I would like to know how to enable Daylight saving support for Debian 9 with LXDE. My timezone is set to Europe/Rome. However my clock is one hour ahead and - considering Daylight saving - it shouldn't.


Running date from the terminal I get:

Mon 25 Feb 11:30:40 CET 2019

With date --utc:

Mon 25 Feb 10:30:40 UTC 2019


Correct UTC time from https://time.is/it/UTC should be:

Mon 25 Feb 09:30:40 UTC 2019

4
  • Dual booting with Windows, not using NTP or NTP blocked in firewall? Feb 25, 2019 at 9:56
  • @RuiFRibeiro Yes, I'm dual booting with Windows. I just noticed that ntpdate is not working and it gives me this error ntpdate[2883]: no servers can be used, exiting. Moreover the Bios was set to the result of date --utc. I changed it to correct UTC. Now I've got correct time, but at startup Linux said something about hardware clock being incorrect.
    – user337887
    Feb 25, 2019 at 10:10
  • ntpdate shows that message by default if I am not wrong. You will have the time problem each time you come from Windows....does installing chrony fixes your time? Feb 25, 2019 at 10:16
  • @RuiFRibeiro I don't know how chrony works. I'll try to read some docs. I'll let you know. Thanks for now.
    – user337887
    Feb 25, 2019 at 10:25

1 Answer 1

1

First: there is no Daylight saving time in Winter in Europe, so your question is probably not about DST, but the difference between local time and UTC.

Many Linux distributions will store the time in the system's builtin Real Time Clock (RTC) at the halt/reboot phase and read it at boot.

Below, 1. is probably not used anymore, so if not sure try 2. first.

  1. Usually this was done with the hwclock command. This command on first usage, will create the file /etc/adjtime and among other values, store an information: if the RTC is to be considered as UTC or local time. UTC is probably the default, since it has always been the time Unix cares about, keeping UTC internally, computing localtime from UTC when needed. Now since at least historically Windows was using local time, it stores local time on the RTC. So if the wrong default for your use case (dual boot) was chosen, you could have altered it with (after correcting time):

    hwclock --systohc --localtime
    

    The way /etc/adjtime is used anyway (clock drift correction...), it's best to delete this file before having changed the time and using this command (which will recreate it).

  2. Today, with systemd attempting to cover all bases, systemd also provides tools for setting time. So the modern equivalent which also uses /etc/adjtime should be instead:

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

    This will re-read the RTC but consider it to be local time and also save the setting.

All this doesn't prevent you to use ntpdate (one shot sync) and chronyd (or ntpd or openntpd ...) to synchronise time with precise sources.

You must log in to answer this question.