View/Modify Linux Time Zone and Time

  

View/Modify Linux Time Zone and Time

I. Time Zone

1. View current time zone

date -R

2. Modify the setup time zone

Method (1)

tzselect

Method (2) RedHat Linux and CentOS only

timeconfig

Method (3) Applies to Debian

dpkg-reconfigure tzdata

3. Copy the corresponding time zone file, replace the system time zone file; or create a link file

Cp /usr/share/zoneinfo/$main time zone/$time zone/etc/localtime

Available in China:

cp /usr/share/zoneinfo/Asia/Shanghai /etc/Localtime

Second, time

1. View time and date

date

2. Set time and date

Command set to June 10, 1996

date -s 06/22/96

Set the system time to 1:5:00 PM =

date -s 13:52:00

3. Will be The previous time and date are written to the BIOS to avoid failure after restart.

hwclock -w

Third, timing synchronization time

* * * * * /usr/sbin/ntpdate 210.72 .145.44 > /dev/null 2>&1

Copyright © Windows knowledge All Rights Reserved