centOS Modify system time, time zone

 

-- View current time zone

# date +%z

-0800

 

-- View current system time and time zone

# date -R

Thu, 05 Jan 2017 18:03:45 -0800

 

-- Modify the system time zone to Beijing time in Dongba District

# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

cp: overwrite ‘/etc/localtime’?

Enter y and press Enter

 

 -- View the current system time and time zone again

# date -R

Fri, 06 Jan 2017 10:06:43 +0800

 

illustrate

+0800 is Beijing time in China . If it says +0800 (East Eighth District), it means china standard time .

 

When you are not connected to the Internet, you can modify the system time (because if you are connected to the Internet, it will generally automatically synchronize with the Internet time).

set date time

# date -s "2012-11-03 10:25:25"

 

Write the current time and date into the BIOS to avoid failure after restarting

 

# hwclock -w

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326359345&siteId=291194637