Set or modify the Linux time zone, date, time

xiaoxiao2021-03-17  193

Local vs. UTC first important problem is that you use UTC or Local Time.utc (Universal Time Coordinated) = GMT (Greenwich Mean Time) Local Time is the time traditional POSIX computer on your watch (Solaris, BSD, UNIX) uses UTC Format Linux can handle the use of UTC time and the footwind of Windows to use UTC or Local Time to determine: If there is Linux and Windows on the machine, it is recommended to use Local Time if there is only Linux on the machine. After using the UTC to determine Edit / etc / sysconfig / clock, utc = 0 is local time; utc = 1 is UTC (GMT) to determine Timezone run Tzselect, will tell you the name of the time zone, such as "Asia / Shanghai", He wrote down (later I use $ TIMEZONE instead) Set TimeZone # cp / usr / share / zoneInfo / $ TIMEZONE / ETC / LOCALTIME Restart or Run the Clock Setup Script If the difference is different from the distribution difference, the above file The location may be different. Generally set the startup script used by the clock to /etc/rc.d/init.d/setClockRedhat is set in /etc/rc.d/rc.sinit, so it is usually restarted

Remarks:

Use the following command to modify the date and time of the system:

[root @ gosling root] # Date 030501482006 March 5 01:48:00 HKT 2006

Use only the following command to modify the system time:

[root @ gosling root] # Date -s 01:48:00

转载请注明原文地址:https://www.9cbs.com/read-129509.html

New Post(0)