Orario errato: due ore in anticipo

Capita a qualcun altro?
Alle 22.41 l’orologio indica un’orario errato, il comando “date” restituisce un orario di due ore in anticipo.
$ date
gio 21 giu 2018, 20.41.59, CEST
stessa cosa il comando hwclock
# hwclock -r
2018-06-21 20:41:34.946332+02:00
Da notare che il Netwrk Time Protocol è attivo e il fuso orario è “Europa/Roma”.
Anche con collegamento alla rete attivo l’orario non si corregge.

A me capita avendo nello stesso pc sia Linux che windows. In questo caso credo che sia un problema conosciuto e avevo letto un workaround da qualche parte.

Modifica post: in Lx 3 OM usa timedatectl per configurare e controllare ora e data. Anche il fatto che il tuo problema è un offset di 2 ore e il tuo tz (Roma) locale è compensato 2 ore dall’UTC è una grande chiave.

Post edit: In Lx 3 OM uses timedatectl to configure and control time and date. Also the fact that your problem is a 2 hour offset and your local tz (Roma) is offset 2 hours from UTC is a big key.

1 Like

La configurazione corretta è impostare la data del BIOS sul fuso orario GMT e quella del sistema operativo su quella della tua zona (CEST). Questo evita ai programmi di confondersi.

1 Like

Qual è la differenza tra hwclock e l’orologio del BIOS? Pensavo fossero la stessa cosa. In altre parole, il comando ‘timedatectl set-local-rtc 1’ o ‘timedatectl set-local-rtc 0’ sta per impostare l’orologio BIOS o CMOS o RTC?

È quello che dici vero per i sistemi Windows? Sono un sistema Windows particolarmente utile prima che Win 10 voglia hwclock impostato sull’ora locale normalmente.

What is the difference between hwclock and BIOS clock? I thought they were same thing. In other words the command ‘timedatectl set-local-rtc 1’ or ‘timedatectl set-local-rtc 0’ is going to set BIOS or CMOS or RTC clock?

Is what you say true for Windows systems? I’m positive Windows systems especially any before Win 10 want hwclock set to local time normally.

Addenda: Time - ArchWiki

Nessuna.

Sono tre modi per chiamare la stessa cosa. Il comando timedatectl set-local-rtc modifica l’orologio hardware, poi, però, bisogna modificare di conseguenza quello del sistema operativo. Ecco l’estratto dal manuale

Qui consiglia di mantenere l’orologio RTC in modalità UTC.

:thinking:

Postedit: Qui è spiegato in maniera più precisa.

1 Like

Questo è un grande documento. Mentre può essere più preciso da un punto di vista tecnico, sta davvero dicendo qualcosa di diverso dai 2 link che ho postato sopra? Stavo cercando di indicare all’utente una semplice spiegazione per capire se questo è o meno il suo problema e se è il suo problema ci vuole un comando per correggerlo.

Ora e data sono un eccellente esempio di un problema di informatica in cui @mandian e @ ben79 possono impiegare 10 o 100 volte più a lungo, spiegando come funziona tutto quanto basta per eseguire le impostazioni.

FWIW: puoi impostarlo tutto su un sistema operativo in meno di 2 minuti. Su qualsiasi sistema Linux che usa systemd come OpenMandriva è possibile impostare tutto con il comando ‘timedatectl’. È davvero più facile da fare che spiegarlo.

That is a great document. While it may be more precise from a technical standpoint is it really saying anything different from the 2 links I posted above? I was trying to point the user to a simple explanation that would get to whether this is or is not his issue and if it is his issue it takes one command to correct it.

Time and date is an excellent example of a computer science issue where @mandian and @ben79 can take 10 or 100 times longer explaining how it all works than it takes to just do the settings.

FWIW: You can set all of it on one operating system in less than 2 minutes. On any Linux system that uses systemd like OpenMandriva < whatever > you can set all of it with the ‘timedatectl’ command. It really is easier to do than to explain it.

1 Like

Allora, il workaround (o la soluzione) a cui mi riferivo è questo post di @jclvanier.
E’ nel forum francese, penso che cmq non dovrebbe essere troppo difficile da capire.

In realtà prima di tutto bisognerebbe sapere se il problema di Giorgio è riconducibile al dual boot con windows o se invece dipende da tutt’altro :wink:

1 Like

La coesistenza tra Windows e OpenMandriva provoca di problemi di orario che io ho risolto da tempo, basta impostare in OMV l’orario hardware “non in GMT”.
Qui invece il problema è un altro, c’è differenza tra OpenMandriva e Linux Mint, con OMV l’ora è in anticipo , riavviando in Linux Mint l’ora è corretta, se si ritorna a OpenMandriva l’ora è di nuovo sbagliata.
Ultima considerazione: il problema è comparso da poco, senza che io cambi niente nelle impostazioni, quindi è dovuto molto probabilmente a qualche aggiornamento.

Windows ha no role in this behaviour. Rebooting in Linux Mint set time at correct value, rebooting again in OMV take the clock two hours in advance.

Questo probabilmente significa che non hai hwclock impostato lo stesso entrambi i sistemi Linux. Dal momento che Linux Mint ha l’ora esatta è hwclock (aka: RTC) sarà probabilmente trovato per essere impostato su ora locale. E poiché il tuo sistema OpenMandriva sembra riportare l’ora UTC, probabilmente troverai che hwclock è impostato su UTC. (Esempio da seguire.)

Per quanto fosse qualcosa di OM, non posso dire. Normalmente le distribuzioni Linux non fanno nulla che cambierebbe il hwclock sul computer di qualcuno. Il fatto che, per quanto ne so, nessun altro abbia segnalato questo rende meno probabile che sia qualcosa che OM ha fatto.

A parte: Ho un paio di computer con dual boot Windows 10 / OM Lx e questo capita occasionalmente. Non sono mai stato in grado di scoprire cosa lo causa. Ma la natura dei test che faccio con OM mi porta a fare ogni sorta di cose con i miei sistemi di test OM, così ho capito che è qualcosa che ho fatto. Mi chiedo anche se a volte l’interruzione di corrente potrebbe causare qualcosa con questo. Ma questa è speculazione.

That most likely means you don’t have hwclock set the same both Linux systems. Since Linux Mint has the correct time it’s hwclock (aka: RTC) will probably be found to be set to local time. And since your OpenMandriva system seems to be reporting UTC time you will probably find that it’s hwclock is set to UTC. (Example to follow.)

As far as it being something OM did I can’t say. Normally Linux distros don’t do anything that would change the hwclock on someones computer. The fact that as far as I know no one else has reported this makes it less likely that it is something OM did.

Aside: I do have a couple of Windows 10/OM Lx dual boot computers and this happens to me occasionally. I’ve never been able to find out what causes it. But the nature of testing I do with OM leads me to be doing all kinds of things to my OM test systems so I guess it is something I have done. I’ve also wonder if sometimes power outage could cause something with this. But that is speculation.

Per controllare le impostazioni di data e ora:
To check date and time settings:

$ timedatectl
                      Local time: Sat 2018-06-23 13:42:22 CDT
                  Universal time: Sat 2018-06-23 18:42:22 UTC
                        RTC time: Sat 2018-06-23 18:42:19
                       Time zone: US/Central (CDT, -0500)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

Tieni presente che l’ora locale e l’ora universale sono diverse, inoltre l’ora universale e l’ora RTC sono le stesse. Il significato di hwclock è impostato su UTC. Questo è ciò che vorresti per un computer solo Linux. Un computer Windows / Linux dual o multi boot di solito richiede l’ora RTC impostata su Ora locale. Vedi questa linea:
Note that Local time and Universal time are different, further Universal time and RTC time are the same. Meaning hwclock is set to UTC. This is what you would want for a Linux only computer. For a Windows/Linux dual or multi boot computer usually you want RTC time set to Local time. See this line:

RTC in local TZ: no

per Windows / Linux computer dual o multi boot vogliamo che quella linea dica Sì. Cambiare (Ti verrà richiesta la password dell’amministratore):
for Windows/Linux dual or multi boot computer we want that line to say Yes. To change (You will be asked for administrator password):

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

Ora controlla di nuovo:
Now check again:

    $ timedatectl
                      Local time: Sat 2018-06-23 13:48:32 CDT
                  Universal time: Sat 2018-06-23 18:48:32 UTC
                        RTC time: Sat 2018-06-23 18:48:29
                       Time zone: US/Central (CDT, -0500)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: yes

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

Ora abbiamo “RTC in TZ locale: sì”. L’avviso può essere ignorato. Questo modo di impostare è ampiamente considerato il miglior compromesso per computer Windows / Linux dual o multi boot.
Now we have ‘RTC in local TZ: yes’. The warning can be ignored. This way of setting is widely considered the best compromise for Windows/Linux dual or multi boot computers.

Se si desidera annullare la modifica o impostare il proprio computer su UTC per hwclock, effettuare semplicemente:
If one wishes to revert the change or set their computer to UTC for hwclock simply do:

$ timedatectl set-local-rtc 0 --adjust-system-clock

1 Like

Very useful command line. I tried in both operating systems without network connection (to exclude NTP).
Here’s what I get in LinuxMint:
$ timedatectl
Local time: dom 2018-06-24 10:49:20 CEST
Universal time: dom 2018-06-24 08:49:20 UTC
RTC time: dom 2018-06-24 08:49:20
Time zone: Europe/Rome (CEST, +0200)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no

And in OpenMandriva few minutes later
$ timedatectl
Local time: dom 2018-06-24 08:54:09 CEST
Universal time: dom 2018-06-24 06:54:09 UTC
RTC time: dom 2018-06-24 08:54:09
Time zone: Europe/Rome (CEST, +0200)
System clock synchronized: no
systemd-timesyncd.service active: yes
RTC in local TZ: yes

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

RTC has same value, UTC and Local Time don’t.

Mi sono permesso di evidenziare le voci chiave nel tuo post. Questo è esattamente quello che ho detto dall’inizio. Modifica post: L’orologio RTC è uguale a hwclock. RTC=Real Time Clock. Questo deve essere impostato lo stesso per ogni sistema operativo sul tuo computer. TZ=Time Zone

I took the liberty of highlighting the key entries in your post. That is exactly what I’ve been saying from the beginning. Post edit: RTC clock is the same as hwclock. RTC=Real Time Clock. This needs to be set the same for every operating system on your computer.
TZ=Time Zone

This mean:

  • I have to read more carefully @ben79 posts :roll_eyes:

  • I need holydays :desert_island: :beach_umbrella:.

OK, mi è appena successo che mi accadesse in un sistema esistente che sono sicuro che RTC era impostato su UTC (questo è un computer solo Linux), quindi qualcosa è cambiato. Non ho idea di cosa lo abbia cambiato. Fornirà un elenco dei pacchetti di aggiornamento più recenti. Quando ho investigato ho trovato questo:

    $ timedatectl
                          Ora locale: ven 2018-07-13 02:26:18 CDT
                      Ora universale: ven 2018-07-13 07:26:18 UTC
                            Orario RTC: Ven 2018-07-13 02:26:18
                           Fuso orario: Stati Uniti / Centrale (CDT, -0500)
           Orologio di sistema sincronizzato: no
    systemd-timesyncd.service attivo: sì
                     ** RTC in TZ locale: sì **

    Avviso: il sistema è configurato per leggere l'ora RTC nel fuso orario locale.
             Questa modalità non può essere completamente supportata. Creerà vari problemi
             con le modifiche del fuso orario e le regolazioni dell'ora legale. L'RTC
             il tempo non viene mai aggiornato, si basa su strutture esterne per mantenerlo.
             Se possibile, utilizzare RTC in UTC chiamando
             'timedatectl set-local-rtc 0'.

E so di averlo impostato su “** RTC in local TZ: no **”. Quindi c’è qualcosa, o più di una cosa che cambia questo di volta in volta. È possibile che questa impostazione sia cambiata in un altro SO, modificandolo in OM. Gli altri che ho sono openSUSE e Manjaro.

OK I just had this happen to me in an existing system that I’m sure had RTC set to UTC (this is a Linux only computer) so something changed it. I have no idea what changed it. Will provide a list of most recent update packages. When I investigated I found this:

$ timedatectl
                      Local time: Fri 2018-07-13 02:26:18 CDT
                  Universal time: Fri 2018-07-13 07:26:18 UTC
                        RTC time: Fri 2018-07-13 02:26:18
                       Time zone: US/Central (CDT, -0500)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 **RTC in local TZ: yes**

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

And I know I had it set to “RTC in local TZ: no”. So there is something, or more than one thing changing this from time to time. It is possible that this setting changed in another OS thus changing it in OM. The others I have are openSUSE and Manjaro.

Post-edit: L’elenco dei pacchetti aggiornati. Non vedo cosa avrebbe cambiato hwclock / RTC in questa lista?

Post-edit: The updated packages list. I don’t see what would have changed hwclock/RTC in this list?

Questo particolare problema su un computer multi-boot è quasi impossibile da tracciare la causa, a meno che non si veda accadere, e non mi sembra mai di vederlo accadere …

This particular problem on a multi-boot computer is almost impossible to track the cause unless you see it happen, and I never seem to see it happen…