question:
The linux time display error, eight hours less than the normal time, modify the time zone
Sometimes when you use the current time, you will find that the linux time is 8 hours slower than the normal time. This is a time zone problem, just like what I wrote before using a mobile phone to
get a linux server. Such a problem occurs, and I am speechless
solve:
Add file configuration to linux, download it directly, and check it is garbled characters, which can't be done.
Download address: The time zone file is downloaded here , and the password 1234
is downloaded and placed in the soft link directory mapped by the mobile phone, that is,手机根目录/1/file
the mobile phone linu that is not used under the / folder directly skips this step
First check if this folder exists
/usr/share/zoneinfo
Then move to linux, this command is to start linux, entered in linux
mv /data/data/com.termux/files/home/file/Asia.zip /usr/share/zoneinfo
enter directory
cd /usr/share/zoneinfo
Unzip the compressed package
unzip Asia.zip
Copy the file, if localtime exists, you can delete it first
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
or create a link
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
If you are testing in java, you need to restart the jar to reload the new time configuration. You
can also enter date to view the time
The displayed results can be set