centos7修改当前系统时区为newyork
时间: 2023-05-27 09:04:41 浏览: 119
1. 查看当前系统时区:
使用以下命令查看当前系统的时区:
```
timedatectl
```
输出结果如下:
```
Local time: Wed 2021-06-16 09:01:02 UTC
Universal time: Wed 2021-06-16 09:01:02 UTC
RTC time: Wed 2021-06-16 09:01:02
Time zone: UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
```
2. 修改系统时区:
使用以下命令修改系统时区:
```
timedatectl set-timezone America/New_York
```
3. 验证修改结果:
重新执行 timdatectl 命令,查看时区是否修改成功:
```
Local time: Wed 2021-06-16 05:01:02 EDT
Universal time: Wed 2021-06-16 09:01:02 UTC
RTC time: Wed 2021-06-16 09:01:02
Time zone: America/New_York (EDT, -0400)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: yes
```
阅读全文