Rechercher dans ce blog

Affichage des articles dont le libellé est timedatectl. Afficher tous les articles
Affichage des articles dont le libellé est timedatectl. Afficher tous les articles

dimanche 22 janvier 2023

ubuntu set hwclock ntpq

+/_ remplacement pour l'ancienne commande ntpq qui n'est plus installée

ntpq.sh

#!/bin/bash
systemctl status systemd-timesyncd.service

 

Utile en dual boot avec Windows dont hwclock est en local.

Sur ma machine après mise en veille d'ubuntu, l'heure n'est pas correcte.

resetclock.sh

#!/bin/bash
timedatectl set-ntp false
timedatectl set-ntp true
timedatectl set-local-rtc true



jeudi 11 février 2021

Set Clock Time on Dual-Boot Systems

If you're dual-booting Ubuntu 18.04 and Windows 10, you may find that changing time in one system affects the other and the two systems can't display the same time.

This happens as Ubuntu interprets the hardware clock or real time clock (RTC) in universal time (UTC) by default while Windows 10 maintains the clock in local time.

You can fix this by keeping RTC in local time in Ubuntu by running a command in the terminal below.

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

To undo this setting, enter the command below.

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

 

Alternative:

As an alternative, you can also make Windows use UTC so that it's consistent with that used in Ubuntu.

Download this registry file WindowsTimeFixUTC and double click on it to run the file in Windows.

Then run this command sc config w32time start= disabled in a command prompt as an administrator to configure the Service Control in Windows so that it will not continue to write local time.