How to set the current time for linux time zone synchronization ?, Linux time zone

Source: Internet
Author: User

How to set the current time for linux time zone synchronization ?, Linux time zone

Set the current time for linux time zone Synchronization

I. Time Zone

1. view the current time zone

Date-R

2. Modify the time zone

Method (1) tzselect

Method (2) Limited to RedHat Linux and CentOS

Timeconfig

Method (3) applicable to Debian

Dpkg-reconfigure tzdata

3. Copy the corresponding time zone file to replace the system time zone file. Alternatively, create the link file cp/usr/share/zoneinfo/$ main Time Zone/$ Time Zone/etc/localtime

Available in China:

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

Ii. Time

1. view the time and date

Date

2. Set the time and date

Set the system date to the June 10, 1996 command date-s 06/22/96

Set the system time to 01:52:00 P.M..

3. Write the current time and date to the BIOS to prevent failure after restart

Hwclock-w

3. Scheduled synchronization time (added in/etc/crontab)

* ***/Usr/sbin/ntpdate 210.72.145.44>/dev/null 2> & 1

In addition:

1. manual synchronization:

Ntpdate 210.72.145.44 #210.72.145.44 provided by Xi'an Emy of Sciences

Ntpdate 219.158.14.130 # provided by Beijing Netcom

2. After synchronization, write the time information to the bios

Hwclock-w

3. For centos systems, use yum install ntp to update ntpdate without the command;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.