Ubuntu Timezone Setup Guide

You can configure the system time and timezone in Ubuntu by following these steps:

  1. Open the terminal and enter the following command to open the time and date settings interface:
sudo timedatectl set-timezone 时区

For example, to set the time zone to China Shanghai time, you can input the following command:

sudo timedatectl set-timezone Asia/Shanghai
  1. Check the current system time and timezone settings.
timedatectl

This will display the current system time, time zone, and NTP synchronization status.

  1. If you need to manually adjust the system time, you can use the following command:
sudo date --set="YYYY-MM-DD HH:MM:SS"

In this case, YYYY-MM-DD represents the date, while HH:MM:SS represents the time.

  1. To automatically synchronize the system time using Network Time Protocol (NTP), you can install and enable the NTP service.
sudo apt-get install ntp
sudo systemctl enable ntp
sudo systemctl start ntp

By following the above steps, you can configure the system time and timezone in Ubuntu.

bannerAds