How to change the Universal time in Linux?
To change the Universal time of a Linux system, you can utilize the command line tool timedatectl.
Here are the steps for adjusting the Universal time:
- Open the terminal and login as the root user or a user with sudo permissions.
- Use the following command to view the current Coordinated Universal Time and time zone:
timedatectl
- Modify the Universal Time using the following command:
timedatectl set-time "YYYY-MM-DD HH:MM:SS"
The format YYYY-MM-DD represents the date, while HH:MM:SS represents the time.
- Use the following command to change the time zone:
timedatectl set-timezone "时区"
For example, to change the time zone to Asia/Shanghai:
timedatectl set-timezone Asia/Shanghai
- Use the following command to verify the changes:
timedatectl
Confirm that the Universal time and time zone have been successfully updated.
Please note that modifying Universal Time may require root or sudo privileges.