ubuntu设置系统时间(北京时间+时区)

1、查看当前系统时间
fk@ubuntu:~$ date -R
Wed, 25 Dec 2019 18:43:29 -0800

2、选择时区
fk@ubuntu:~$ tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, “coord”, or “TZ”.

  1. Africa
  2. Americas
  3. Antarctica
  4. Asia
  5. Atlantic Ocean
  6. Australia
  7. Europe
  8. Indian Ocean
  9. Pacific Ocean
  10. coord - I want to use geographical coordinates.
  11. TZ - I want to specify the time zone using the Posix TZ format.
    #?

依次输入4 (Asia),9(China),1(Beijing),1(Shanghai)

3.复制文件到/etc目录下
fk@ubuntu:~$ sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

4.查看时间date -R,为北京时间
fk@ubuntu:~$ date -R
Thu, 26 Dec 2019 10:52:24 +0800

5、发现显示时间是对的,但是终端时间还是没有同步,重启即可
fk@ubuntu:~$ sudo reboot now

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值