乐趣区

关于linux:Linux-查看及修改时区

查看工夫及时区
查看以后工夫

date
1
查看时区

cat /etc/timezone
1
批改时区
1. 批改或设置 Linux 服务器时区

tzselect
1
RedHat Linux/CentOS

timeconfig
1
Debian

dpkg-reconfigure tzdata
1
2. 设置环境变量

echo “export TZ=’Asia/Shanghai'” >> /etc/profile
source /etc/profile
1
2
3. 创立软链接

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
1
应用 timedatectl 命令

timedatectl set-timezone Asia/Shanghai
1
硬件工夫
查看硬件工夫
hwclock –show
1

clock –show
1
设置硬件工夫
hwclock –set –date=”19/03/12 21:55″
1

clock –set –date=”19/03/12 21:55″
1
同步零碎及硬件时钟
hc 代表硬件工夫,sys 代表零碎工夫,systohc 示意以零碎工夫为基准,同步至硬件工夫

hwclock –systohc
1

clock –systohc
参考链接:
2 Ways to check timezone in Linux

退出移动版