Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to set and modify the system time zone in CentOS

Shulou Source: shulou.com Published: 2022-06-01 18:34:49 11月16日 Update

Today, I will talk to you about how to set and modify the time zone of the system in CentOS. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

I. time zone

1. View current time zone

Date-R

two。 Modify the setting time zone

Methods (1)

Tzselect

Method (2) is limited to RedHat Linux and CentOS systems.

Timeconfig

Method (3) is suitable for Debian.

Dpkg-reconfigure tzdata

3. Copy the appropriate time zone file and replace the CentOS system time zone file, or create a link file

Cp / usr/share/zoneinfo/$ Primary time Zone / $Sub time Zone / etc/localtime

It can be used in China:

Cp / usr/share/zoneinfo/Asia/Shanghai / etc/localtime

Second, time

1. Check the time and date

Date

2. Set time and date

Order setting the CentOS system date to June 10, 1996

Date-s 06Universe 22 Universe 96

Command to set the CentOS system time to 01:52:00

Date-s 13:52:00

3. Write the current time and date to BIOS to avoid invalidation after restart

Hwclock-w

Timing synchronization time

# / usr/sbin/ntpdate 210.72.145.44 > / dev/null 2 > & 1

After reading the above, do you have any further understanding of how to set and modify the system time zone in CentOS? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Time zone system time date content documents methods commands more knowledge articles industry information information channels links channels China enter one synchronization support Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Information Redmi MariaDB macOS