debian 设置时区的两种方式

如果租用的是美国或者其他国家的 debian 或者 ubuntu VPS,我们在使用的时候会有时差,我们可以给服务器设置时区,查看日志等时候就不会出现时差,方便我们管理、维护。

1. dpkg-reconfigure

debian 设置时区

root 用户登录服务器,执行 dpkg-reconfigure tzdata 命令,会出现一个交互式的界面,使用上下箭头选取时区,Enter 键确定,Tab 键选择下面的 <Ok> 或者 <Canel> 。

交互式的界面,无需编辑文件就能直接更改系统的时区,推荐。

2.timedatectl

root 用户登录服务器,执行 timedatectl set-timezone "Asia/Shanghai" 就可以设置时区,不同的时区还需要记住,没有前面一种设置方便。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>