Update the system time & View / Modify LINUX time zone and time

A time zone
0. date '+% Y% M % D' in a format to display the current date, the following results:

date "+%Y-%m-%d %H:%M:%S"
 

1. Check the current time zone: [root @ master ~] # date "+% Z"

2. Modify setting area
    method (1): [root @ master ~] # tzselect
    Method (2): Only on RedHat Linux and CentOS: [root @ master ~] # imeconfig
    Method (3): for Debian: [root @ master ~] # dpkg-the reconfigure tzdata
3. copy the appropriate time zone file, when replacing the system zone file; or create a link file cp / usr / share / zoneinfo / time $ main area / time $ time zone / etc / localtime
    China can be used:
    CP / usr / share / zoneinfo / Asia / Shanghai / etc / localtime

 Second, the time
1, check the time and date: [root @ master ~] # date

2, set the time and date:
      The system date is set to command the 10 June, 1996 to: [root @ master ~] # date -s 06/10/1996
               
      system time is set to 13:52:00 the command: [root @ master ~] # date -s 13:52:00

3, time synchronization server:

     [root@master bin]# ntpdate -u ntp.api.bz
     18 Sep 03:53:08 ntpdate[28192]: step time server 182.92.12.11 offset 274463.953481 sec

Common ntp server:
China National Time Service Center: be input the blank
the NTP server (Shanghai): ntp.api.bz
United States: time.nist.gov
Fudan: ntp.fudan.edu.cn
Microsoft granted host (United States): time.windows .com
Beijing University of Posts: s1a.time.edu.cn
Tsinghua University: s1b.time.edu.cn
Peking University: s1c.time.edu.cn
Taiwan police big time Service Center (Taiwan): asia.pool.ntp.org

4, the current date and time to write the BIOS, to avoid restart failure: [root @ master ~] # hwclock -w

Description: Centos system, if there is no command yum install ntp ntpdate update;

Three, Linux 24-hour time is set to
## CentOS system
terminal input commands: tzselect

prompted to select:
. 5 ->. 9 ->. 1 ->. 1 -> OK
RM / etc / localtime
LN -SF5 / usr / report this content share / zoneinfo / Asia / on Shanghai / etc / localtime
DATE
hwclock -w


Guess you like

Origin www.cnblogs.com/gucb/p/11493412.html