服务器时间修改 utc,将服务器时间类型改为UTC(0000)

方法一:

# timedatectl  set-timezone UTC

#  timedatectl set-time "YYYY-MM-DD HH:MM:SS"

#  timedatectl set-time   "HH:MM:SS"

# timedatectl

format,png

我们可以看到,服务器时间类型更改为UTC了

# ll   /etc/locatime

lrwxrwxrwx. 1 root root 25 1月  14 08:30 /etc/localtime -> ../usr/share/zoneinfo/UTC

实际上是做了一个将

文件  /etc/localtime  做了一个软连接到 /usr/share/zoneinfo/UTC

方法二:

#  ln  -s   /usr/share/zoneinfo/UTC    /etc/localtime

ln: 无法创建符号链接"/etc/localtime": 文件已存在

#  ln  -sf /usr/share/zoneinfo/UTC    /etc/localtime

做软连接时,需要加 -f 参数,强制覆盖,不然会显示软链接已存在

#  timedatectl set-time "YYYY-MM-DD HH:MM:SS"

#  timedatectl set-time   "HH:MM:SS"    //只设置时分秒

# timedatectl

format,png

原文:https://www.cnblogs.com/qiumingcheng/p/11708465.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值