When you find that time is a thief, it has already stolen the light of your choice.
One, GMT, UTC, CST
GMT: (Greenwich Mean time) GMT, the Sun passes Greenwich that moment as the standard for timekeeping.
UTC: (coordinated Universal time) international coordination times, provided by the physical clock.
CST: Standard Time in the United States, Australia or China. Chinese Standard Time: ut+8:00
Second, Linux has hardware clock and software clock two kinds
Hardware clocks (real-time clocks real-time clock) are provided by the crystal oscillator on the motherboard.
The system clock refers to the clock in the kernel.
Linux reads the hardware clock and synchronizes it to the system clock when it is powered on.
Three, related orders
View system time
[[Email protected] ~]# timedatectl Local Time: Thu .- Geneva- - +: -: $CST Universal Time: Thu .- Geneva- - -: -: $UTC RTC Time: Thu .- Geneva- - -: -: $Timezone:asia/shanghai (CST, +0800) NTP enabled:yesntp synchronized:yes RTCinchlocal Tz:no DST active:n/A
Setting the system time
[Email protected] ~]# timedatectl set-time"1989-01-15 05:55" //date-s " 19890115 05:55:00 "
[Email protected] ~]# timedatectl set-time 1989-01-15 //date-s 19890115
[Email protected] ~]# timedatectl set-time 05:55 " //date-s 05:55
View all time zones
[Email protected] ~]# timedatectl list-timezonesafrica/abidjanafrica/accraafrica/ Addis_ababaafrica/algiers
...
Change the system time zone
[Email protected] ~]# timedatectl set-timezone africa/date:27 :1989~]# timedatectl set-timezone asia/date from: £1989
Or
[Email protected] ~]#DateThu Feb - -: About: +Cst .[[Email protected]~]#RM-f/etc/localtime [[email protected]~]#DateThu Feb - -: About: +Utc .[[Email protected]~]#LN-s/usr/share/zoneinfo/asia/shanghai/etc/Localtime[[email protected]~]#DateThu Feb - +: $: ACst .
Change the system time to hardware time
[Email protected] ~]#Date-S20130123Wed Jan at xx:xx:xxCst -[[Email protected]~]# Clock Thu -Feb . ,: -: -PM CST-0.971377Seconds[[email protected]~]# Clock-W[[Email protected]~]# clockwed atJan - A:xx: -AM CST-0.437733Seconds
Change hardware time to system time
[[Email protected] ~]# clockwed atJan - A: to: AAM CST-0.382773Seconds[[email protected]~]#Date-S20080808Fri8 xx:xx:xxCst -[[Email protected]~]# Clock-s [[email protected]~]#DateWed Jan at xx: .: -Cst -
RHEL7 Study notes on time