在新的centos7里,关于时间的指令除了保留了之前版本中常用到的date、hwclock等命令外,还增加了一个统一的命令timedatactl。下面结合其用法进行下小结。
查看 timedatectl 指令用法帮助
[root@361way ~]# timedatectl --help
timedatectl [OPTIONS...] COMMAND ...
Query or change system time and date settings.
-h --help Show this help
--version Show package version
--adjust-system-clock
Adjust system clock when changing local RTC mode
--no-pager Do not pipe output into a pager
-P --privileged Acquire privileges before execution
--no-ask-password Do not prompt for password
-H --host=[USER@]HOST Operate on remote host
Commands:
status Show current time settings
set-time TIME Set system time
set-timezone ZONE Set system timezone
list-timezones Show known timezones
set-local-rtc BOOL Control whether RTC is in local time
set-ntp BOOL Control wh