Linux 修改时区

本文详细介绍了如何在CentOS7系统中修改时间设置,包括查看系统版本、当前时区,以及如何更改到Dubai时区的具体步骤。同时也提供了CentOS6系统下设置时区的方法。
CentOS 7修改方式如下:
# lsb_release -a  --查看系统版本-CentOS Linux release 7.6
# timedatectl     --查看当前系统时区
# ls -l /etc/localtime
# timedatectl list-timezones | grep 'Dubai' 或者grep 'Shanghai'查看国内时期。这里我要修改为Dubai时间。
Asia/Dubai
# timedatectl set-timezone Asia/Dubai
# ll /etc/localtime
lrwxrwxrwx 1 root root 32 Apr 21 18:58 /etc/localtime -> ../usr/share/zoneinfo/Asia/Dubai
 
You need to use the ln command to set timezone on Centos 6. Type the following commands as root:
cp /etc/localtime /root/old.timezone
rm /etc/localtime
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
Verify new settings by typing the following two commands:
date
ls -l /etc/localtime

转载于:https://www.cnblogs.com/rusking/p/10747682.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值