date
[root@localhost all_equipment_data]# date
Thu Aug 12 10:20:50 EDT 2021
查看时区
date -R
[root@localhost all_equipment_data]# date -R
Thu, 12 Aug 2021 10:20:57 -0400
修改时区
将Asia/shanghai-上海时区写入当前时区
提示是否覆盖,输入Y回车
cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
再次查看时区:
[root@localhost all_equipment_data]# date
Thu Aug 12 22:22:30 CST 2021
[root@localhost all_equipment_data]# date
Thu Aug 12 10:20:50 EDT 2021
[root@localhost all_equipment_data]# date -R
Thu, 12 Aug 2021 10:20:57 -0400
[root@localhost all_equipment_data]# cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
cp: overwrite ‘/etc/localtime’? y
[root@localhost all_equipment_data]# date
Thu Aug 12 22:22:30 CST 2021
[root@localhost all_equipment_data]#
EDT 改成了 CST
修改时间
date -s 10:30
clock -w
查看时区和时间(CST,中国时区)
date