How to set the time zone in linux

WBOY
Release: 2021-12-28 14:27:08
Original
17825 people have browsed it

Method: 1. Execute the tzselect command in the terminal; 2. Select the "Asia" - "China" - "Beijing Time" - "yes" items in sequence; 3. Execute "TZ='Asia/Shanghai'; export TZ" command and add it to ".profile" and log in again.

How to set the time zone in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to set the time zone in Linux

#When starting to set the time zone, refer to the information on the Internet and use the tzselect command. It turns out that the tzselect command is just It tells you how to set the time zone without actually modifying the /etc/sysconfig/clock file.

In other words, the tzselect command only tells us the time zone selected by setting the TZ environment variable, and then adds the variable to the .profile file. The following is a brief introduction on how to use the tzselect command to set the time zone, and how to set the time zone by modifying the /etc/sysconfig/clock configuration file.

tzselect:

Execute the tzselect command-->Select Asia-->Select China-->Select east China - Beijing, Guangdong, Shanghai, etc-->Then enter 1. The process is as shown below:

How to set the time zone in linux

How to set the time zone in linux

How to set the time zone in linux

How to set the time zone in linux

# After executing the tzselect command After selecting the time zone, the time zone has not changed. It only prompts at the end of the command that you can execute TZ='Asia/Shanghai'; export TZ and add this line of command to the .profile, then log out and log in again. Refer to the results seen by the date command in the figure below. The final time zone is displayed as CST, which is China Standard Time.

Related recommendations: "

Linux Video Tutorial"

The above is the detailed content of How to set the time zone in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template