Ubuntu 区时修改

linux默认使用UTC区时,查看起来不方便。因此可以改变区时为亚洲上海。改动方法如下:

使用date命令查看时间

date

结果是UTC区时:

Tue Jan  4 07:45:25 UTC 2022

改动区时命令:(使用时间2022-1-4,网络上博客大多给出的是 sudo tzconfig,但是该命令已经不支持了)

dpkg-reconfigure tzdata

然后就会让选择洲和城市,依次选择亚洲(选择Asia对应序号)和上海(对应序号)就可以了。

Configuring tzdata
------------------

Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by
presenting a list of cities, representing the time zones in which they are located.

  1. Africa   3. Antarctica  5. Arctic  7. Atlantic  9. Indian    11. SystemV  13. Etc
  2. America  4. Australia   6. Asia    8. Europe    10. Pacific  12. US
Geographic area: 6

Please select the city or region corresponding to your time zone.

  ...
  10. Bahrain  25. Dushanbe     40. Karachi      55. Novokuznetsk  70. Shanghai       85. Vientiane
  ...
  
Time zone: 70


Current default time zone: 'Asia/Shanghai'
Local time is now:      Tue Jan  4 15:47:38 CST 2022.
Universal Time is now:  Tue Jan  4 07:47:38 UTC 2022.

如果提示tzdata is not installed,安装即可:

sudo apt-get install tzdata

安装后会直接提示修改区时,直接参考上面的操作,进行设置即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值