rtc测试

发布时间 2023-06-29 13:25:25作者: 罗论明

[root@localhost ~]# date -s "12:20"
Thu Jun 29 12:20:00 CST 2023
[root@localhost ~]# hwclock -w
[root@localhost ~]# timedatectl
Local time: Thu 2023-06-29 12:20:14 CST
Universal time: Thu 2023-06-29 04:20:14 UTC
RTC time: Thu 2023-06-29 12:20:15
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not 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'.
[root@localhost ~]# ntpdate -u 203.107.6.88
29 Jun 12:34:23 ntpdate[1990]: step time server 203.107.6.88 offset 831.497776 sec
[root@localhost ~]# timedatectl
Local time: Thu 2023-06-29 12:34:32 CST
Universal time: Thu 2023-06-29 04:34:32 UTC
RTC time: Thu 2023-06-29 12:20:41
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not 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'.
[root@localhost ~]# systemctl restart ntpd
[root@localhost ~]# systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2023-06-29 12:35:06 CST; 6s ago
Process: 2004 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 2005 (ntpd)
CGroup: /system.slice/ntpd.service
└─2005 /usr/sbin/ntpd -u ntp:ntp -g

Jun 29 12:35:06 localhost.localdomain ntpd[2005]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Jun 29 12:35:06 localhost.localdomain ntpd[2005]: Listen and drop on 1 v6wildcard :: UDP 123
Jun 29 12:35:06 localhost.localdomain ntpd[2005]: Listen normally on 2 lo 127.0.0.1 UDP 123
Jun 29 12:35:06 localhost.localdomain ntpd[2005]: Listen normally on 3 ens33 192.168.12.29 UDP 123
Jun 29 12:35:06 localhost.localdomain ntpd[2005]: Listen normally on 4 lo ::1 UDP 123
Jun 29 12:35:06 localhost.localdomain ntpd[2005]: Listen normally on 5 ens33 fe80::3078:750b:dcf7:d446 UDP 123
Jun 29 12:35:06 localhost.localdomain ntpd[2005]: Listening on routing socket on fd #22 for interface updates
Jun 29 12:35:06 localhost.localdomain ntpd[2005]: 0.0.0.0 c016 06 restart
Jun 29 12:35:06 localhost.localdomain ntpd[2005]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
Jun 29 12:35:06 localhost.localdomain ntpd[2005]: 0.0.0.0 c011 01 freq_not_set
[root@localhost ~]# timedatectl
Local time: Thu 2023-06-29 12:35:14 CST
Universal time: Thu 2023-06-29 04:35:14 UTC
RTC time: Thu 2023-06-29 12:21:23
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not 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'.
[root@localhost ~]# timedatectl
Local time: Thu 2023-06-29 12:35:15 CST
Universal time: Thu 2023-06-29 04:35:15 UTC
RTC time: Thu 2023-06-29 12:21:24
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not 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'.
[root@localhost ~]# timedatectl
Local time: Thu 2023-06-29 12:35:16 CST
Universal time: Thu 2023-06-29 04:35:16 UTC
RTC time: Thu 2023-06-29 12:21:25
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not 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'.
[root@localhost ~]# timedatectl
Local time: Thu 2023-06-29 12:35:17 CST
Universal time: Thu 2023-06-29 04:35:17 UTC
RTC time: Thu 2023-06-29 12:21:26
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not 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'.
[root@localhost ~]# timedatectl
Local time: Thu 2023-06-29 12:35:18 CST
Universal time: Thu 2023-06-29 04:35:18 UTC
RTC time: Thu 2023-06-29 12:21:27
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not 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'.
[root@localhost ~]# timedatectl
Local time: Thu 2023-06-29 12:35:19 CST
Universal time: Thu 2023-06-29 04:35:19 UTC
RTC time: Thu 2023-06-29 12:21:27
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not 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'.
[root@localhost ~]# timedatectl
Local time: Thu 2023-06-29 13:17:08 CST
Universal time: Thu 2023-06-29 05:17:08 UTC
RTC time: Thu 2023-06-29 13:17:07
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not 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'.
[root@localhost ~]# timedatectl
Local time: Thu 2023-06-29 13:17:10 CST
Universal time: Thu 2023-06-29 05:17:10 UTC
RTC time: Thu 2023-06-29 13:17:10
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not 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'.