linux 时区

Posted

##查看当前时区

$ date -R
Wed, xxx Apr xxxx xx:xx:xx +0000

##修改设置时区

如:cp /usr/share/zoneinfo/$主时区/$次时区 /etc/localtime

$sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
$date -R
Wed, xxx Apr xxxx xx:xx:xx +0800

##与时间服务器同步

sudo ntpdate asia.pool.ntp.org
#crontab -e
进入crontab编辑模式,使用方法同vi
输入 0 23 * * * ntpdate asia.pool.ntp.org >> /var/log/ntpdate.log

###补充:

网络时间服务器

微软公司授时主机(美国)
time.windows.com
台警大授时中心(台湾)
asia.pool.ntp.org
中科院授时中心(西安)
210.72.145.44
网通授时中心(北京)
219.158.14.130

修改设置Linux服务器时区

方法 A
命令 : "tzselect"
方法 B 仅限于RedHat Linux 和 CentOS
命令 : "timeconfig"
方法 C 适用于Debian
命令 : "dpkg-reconfigure tzdata"

此文章 短链接: http://dlj.bz/V7Kt7w