700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > Linux系统下查看和修改 系统时间和硬件时间

Linux系统下查看和修改 系统时间和硬件时间

时间:2021-01-19 15:25:09

相关推荐

Linux系统下查看和修改 系统时间和硬件时间

Linux系统下查看和修改 系统时间和硬件时间

1.具体命令使用如下:

查看当前系统时间

[root@littlelawson hbase-1.4.0]# date

Mon Jun 18 10:36:45 PDT

查看网上时间:/shijian/

设置系统时间

[root@littlelawson hbase-1.4.0]# date -s 21:48:00

Mon Jun 18 21:48:00 PDT

写入时间:

clock –w

查看当前硬件时间

[root@littlelawson hbase-1.4.0]# hwclock

Mon 18 Jun 09:51:01 PM PDT -0.969901 seconds

设置硬件时间,'月/日/年 时分'

[root@littlelawson hbase-1.4.0]# hwclock --set --date='06/18/18 21:50:01'

[root@littlelawson hbase-1.4.0]# hwclock --systohc

[root@littlelawson hbase-1.4.0]# hwclock

daMon 18 Jun 09:52:23 PM PDT -0.391427 seconds

[root@littlelawson hbase-1.4.0]# date

Mon Jun 18 21:52:23 PDT

2.关于hwclock[hardware clock]命令

-s, --hctosys

Set the System Time from the Hardware Clock.#以硬件时间为标准,设置系统时间

Also set the kernel’s timezone value to the local timezone as

indicated by the TZ environment variable and/or

/usr/share/zoneinfo, as tzset(3) would interpret them. The

obsolete tz_dsttime field of the kernel’s timezone value is

set to DST_NONE. (For details on what this field used to

mean, see settimeofday(2).)

This is a good option to use in one of the system startup

scripts.

-w, --systohc

Set the Hardware Clock to the current System Time.##以系统时

3,以常见的格式输出

[root@root ~]# date "+%Y-%m-%d %H:%M:%S"

-02-19 13:14:19

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。