[Email protected] etc]# Ls-al localtime*
lrwxrwxrwx. 1 root root 38 November 03:32 localtime. /usr/share/zoneinfo/america/new_york
[[Email protected] etc]# Date
Saturday, March 12, 2016 00:00:57 EST
[Email protected] etc]#
Ln-s. /usr/share/zoneinfo/asia/shanghai localtime
[Email protected] etc]# RM-RF localtime
[Email protected] etc]# ls-s. /usr/share/zoneinfo/a
africa/antarctica/asia/australia/
america/arctic/atlantic/
[Email protected] etc]# ls-s. /usr/share/zoneinfo/a
africa/antarctica/asia/australia/
america/arctic/atlantic/
[Email protected] etc]# ls-s. /usr/share/zoneinfo/asia/shanghai localtime
LS: Unable to access localtime: No file or directory
4.. /usr/share/zoneinfo/asia/shanghai
[Email protected] etc]# ln-s. /usr/share/zoneinfo/asia/shanghai localtime
[Email protected] etc]# ls-al localtime* lrwxrwxrwx. 1 root root 35 March 13:02 localtime. /usr/share/zoneinfo/asia/shanghai
[Email protected] etc]#
[Email protected] sysconfig]# Timedatectl
Local time: Six 2016-03-12 05:10:37 UTC
Universal time: Six 2016-03-12 05:10:37 UTC
RTC time: 62,016-03-12 05:10:37
Time Zone:asia/shanghai (UTC, +0000)
NTP Enabled:yes
NTP Synchronized:yes
RTC in local Tz:no
DST active:n/a
[Email protected] sysconfig]#
Timedatectl Set-timezone Asia/shanghai
[Email protected] sysconfig]# Timedatectl--help
Timedatectl [OPTIONS ...] COMMAND ...
Query or change system time and date settings.
-H--help Show this help message
--version Show Package version
--no-pager do not pipe output to a pager
--no-ask-password don't prompt for password
-H--host=[[email protected]]host Operate on remote host
-M--machine=container Operate on local CONTAINER
--adjust-system-clock adjust system clock when changing local RTC mode
Commands:
Status Show Current time settings
Set-time Time Set system time
Set-timezone Zone Set system time zone
List-timezones Show known time zones
SET-LOCAL-RTC BOOL Control Whether RTC is in local time
SET-NTP BOOL Control whether NTP is enabled
[Email protected] sysconfig]#
"CentOS" localtime