CentOS sets the three skills of system time

  

Different systems set the time method differently, and can set the system time in different ways. For example, CentOS system time setting method has three kinds, the following small series will give you Introduce how CentOS sets the system time.

set the system time of three ways:

1. local system time to time;

2. World time in UTC time for the system partition standard ;

3. NTP time coordination server as the standard time;

Three time settings specific instructions:

1. Local time setting command is clock or hwclockg it The system folder is /etc/localtime

Command Description:

hwclock /clock -w Save the current system time to hardware time.

hwclock /clock --set --date “03/17/2009 13:26:00”

hwclock /clock --show Display current hardware time

Hwclock /clock --hctosys Hardware time synchronization is system time

hwclock/clock –systohc system time synchronization is hardware time

2.UTC time setting command is timeconfig, text interface is started The graphical settings box, its configuration file is saved in /etc/sysconfig/clock

3. The NTP settings require server-side settings and client settings. Configure the NTP server, the configuration file is /etc/ntp.conf

After the configuration is completed, the service ntpd start starts the server

Query the NTP server in the network: ntpq -p

Synchronization NTP time: ntpdate ntpserver (ip or domain name)

--------------------

Common system time setting method:

date -s 12/25/2013 (December 25, 2013)

date -s 15:55:33 (15:55:33)

clock - w

The above is the method of setting the system time of CentOS. Of course, in addition to the three setting methods described in the article, you can also use the data command to set the system time.

Copyright © Windows knowledge All Rights Reserved