系统版本:ubuntu-18.04.6-live-server-amd64
已使用过相关方法:
tzselect
dpkg-reconfigure tzdata
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
输出时间:
root@ubuntu-s:~# date
Tue Mar 12 09:13:16 UTC 2024
root@ubuntu-server:~# hwclock --show
2024-03-12 08:49:16.248765+0000
root@ubuntu-s:~# timedatectl status | grep "Time zone"
Time zone: n/a (UTC, +0000)
root@ubuntu-s:~# cat /etc/localtime
Asia/Shanghai