Redhat 设置北京时间

系统版本

redhat 版本 6.5

[wuxt@localhost ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)

查看当前时间

[wuxt@localhost ~]$ date
Tue Aug 4 18:57:43 PDT 2020

使用 date 命令可以看到当前是 PDT 时间,PDT 即(Pacific Daylight Time)太平洋夏季时间。

修改时区

[wuxt@localhost etc]$ su
Password:
[root@localhost etc]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
cp: overwrite `/etc/localtime’? y

因为 /etc/loacaltime 需要 root 权限才能修改,所以先 su 切到超级用户。
在这里插入图片描述
可以看到 /usr/share/zoneinfo/ 目录下有不同的地方的时间

修改时间

[root@localhost etc]# date
Wed Aug 5 10:05:12 CST 2020

使用 date 命令杳看,当前已经为 CST 时间。

CST可以为如下4个不同的时区的缩写:
美国中部时间:Central Standard Time (USA) UT-6:00
澳大利亚中部时间:Central Standard Time (Australia) UT+9:30
中国标准时间:China Standard Time UT+8:00
古巴标准时间:Cuba Standard Time UT-4:00

根据前面的设置,应该是中国标准时间,但时分秒对不上,再改一下。

[root@localhost etc]# date -s 02:08:30
Wed Aug 5 02:08:30 CST 2020
[root@localhost etc]# date
Wed Aug 5 02:08:34 CST 2020

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值