Ubuntu 修改时区

因为装的是英文版的Ubuntu Server,故时区为美国东部时间。
查找/etc目录后发现在timezone文件中有指定时区。

修改timezone配置为"Asia/Shanghai"即可

echo "Asia/Shanghai" > /etc/timezone

也可以使用以下命令打开交互式界面来更改系统时区

sudo dpkg-reconfigure tzdata

同步时间

ntpdate cn.pool.ntp.org

写入硬件时钟

hwclock -w
文章作者: 若海; 原文链接: https://www.rehiy.com/post/9/; 转载需声明来自技术写真 - 若海

添加新评论