Ubuntu 更改时区


Ubuntu 更改时区

根据需求,需要修改成印度时区IST

  • 显示系统的当前时间和日期

RTC time 就是硬件时钟的时间

1
2
3
4
5
6
7
8
9
timedatectl

Local time: Tue 2018-03-26 08:11:45 UTC
Universal time: Tue 2018-03-26 08:11:45 UTC
RTC time: Tue 2018-03-26 08:11:46
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no
  • 查看当前时区
1
2
3
timedatectl | grep Time

Time zone: Etc/UTC (UTC, +0000)
  • 查看所有可用的时区
1
timedatectl list-timezones
  • 设置本地时区
1
2
3
4
5
6
7
8
9
10
11
sudo timedatectl set-timezone "Asia/Kolkata"

timedatectl

Local time: Tue 2018-03-26 13:48:23 IST
Universal time: Tue 2018-03-26 08:18:23 UTC
RTC time: Tue 2018-03-26 08:18:24
Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no