root@k8s-master1:~# timedatectl
Local time: Sun 2025-05-04 12:44:13 CST
Universal time: Sun 2025-05-04 04:44:13 UTC
RTC time: Fri 2025-05-02 16:21:25
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
root@k8s-master1:~# timedatectl set-ntp 0
root@k8s-master1:~# timedatectl set-time "2023-09-13 18:54:30"
Failed to set time: Previous request is not finished, refusing.
root@k8s-master1:~# timedatectl set-time "2023-09-13 18:54:30"
root@k8s-master1:~# timedatectl
Local time: Wed 2023-09-13 18:54:34 CST
Universal time: Wed 2023-09-13 10:54:34 UTC
RTC time: Wed 2023-09-13 10:54:35
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
NTP service: inactive
RTC in local TZ: no
root@k8s-master1:~# timedatectl set-ntp 0
root@k8s-master1:~# timedatectl set-time "2023-09-13 18:54:30"
root@k8s-master1:~# timedatectl
Local time: Wed 2023-09-13 18:54:34 CST
Universal time: Wed 2023-09-13 10:54:34 UTC
RTC time: Wed 2023-09-13 10:54:35
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
NTP service: inactive
RTC in local TZ: no
root@k8s-master1:~# timedatectl set-time 2025-05-04
root@k8s-master1:~# timedatectl
Local time: Sun 2025-05-04 00:00:01 CST
Universal time: Sat 2025-05-03 16:00:01 UTC
RTC time: Sat 2025-05-03 16:00:01
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
NTP service: inactive
RTC in local TZ: no
root@k8s-master1:~# timedatectl set-time 12:00:00
root@k8s-master1:~# timedatectl
Local time: Sun 2025-05-04 12:00:01 CST
Universal time: Sun 2025-05-04 04:00:01 UTC
RTC time: Sun 2025-05-04 04:00:01
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
NTP service: inactive
RTC in local
root@k8s-master1:~# cat /etc/systemd/timesyncd.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the timesyncd.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# See timesyncd.conf(5) for details.
[Time]
NTP=ntp.aliyun.com
FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
#FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048
#ConnectionRetrySec=30
#SaveIntervalSec=60
root@k8s-master1:~# systemctl daemon-reload; systemctl restart systemd-timesyncd.service