Linux view modified time, time zone

Source: Internet
Author: User
Tags time and date

Yum Install NTP
Ntpdate time.nist.gov
Timedatectl Set-timezone Asia/shanghai
If the above time.nist.gov server is not synchronized, you can change the following several times the server to try:
Time.nist.gov
Time.nuri.net
0.asia.pool.ntp.org
1.asia.pool.ntp.org
2.asia.pool.ntp.org
3.asia.pool.ntp.org

One, view and modify the time zone of Linux
1. View the current time zone
Command: "Date-r"
2. Modify settings for the Linux server time zone
Method A
Command: "Tzselect"
Method B is limited to Redhat Linux and CentOS
Command: "Timeconfig"
Method C applies to Debian
Command: "Dpkg-reconfigure tzdata"
3. Copy the appropriate time zone file, replace the system time zone file, or create a linked file
cp/usr/share/zoneinfo/$ main time zone/$ times time zone/etc/localtime
For example: In set China time zone use Asia/Shanghai (+8)
Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
second, the time to view and modify Linux
1. View time and date
Command: "Date"
2. Set the time and date
Example: Setting the system date to the November 3, 2009 command
Command: "Date-s 11/03/2009"
command to set the system time to 5:55 P.M. 55 seconds
Command: "Date-s 17:55:55"
3. Write the current time and date to the BIOS to avoid failure after reboot
Command: "Hwclock-w"

Note:
Date
Without parameters, you can see the current date and time directly.
Cal
Without parameters you can see this month's monthly calendar directly

Linux viewing modified time, time zone

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.