Linux系统怎么修改时间?通过服务器终端执行date命令即可!

无论在哪个操作系统上准确的时区和时间对于我们来说都非常重要,通常情况下时间错误的概率很非常低的。但是不同区域的服务器默认的时区的并不相同,如果服务器的时区与我们的时区存在差异那么时间也会错误。针对这类问题解决的方法倒是非常简单的,直接上服务器查看时间和时区是否与我们相同并校准下就行了。

具体操作如下

1、查看当前服务器时间直接在终端中执行date命令即可,这台服务器上的时间就有问题:

[root@landian ~]# date ==>查看时间Fri Mar 24 01:33:32 CST 2017[root@landian ~]# date -R ==>查看时区Fri, 24 Mar 2017 01:38:15 +0800

2、修改服务器时区的话在终端中执行tzselect即可开始选择时区,依次是大洲—国家—地区:

[root@landian ~]# tzselectPlease identify a locATIon so that time zone rules can be set correctly.Please select a continent or ocean. 5) Asia ==>大洲列表11) none - I want to specify the time zone using the Posix TZ format.#? 5 ==>选择大洲序列号Please select a country. 9) China ==>国家列表#? 9 ==>选择国家序列号Please select one of the following time zone regions.1) Beijing Time ==>时间列表2) Xinjiang Time#? 1 ==>选择时间序列号The following informATIon has been given: China Beijing TimeIs the above information OK?1) Yes2) No#? 1 ==>确认修改

3、复制相应的时区文件替换掉系统时区文件:

[root@landian ~]# cp /usr/share/zoneinfo/Asia/Beijing /etc/localtimecp: overwrite `/etc/localtime'? yes ==>输入yes回车确认

4、查看当前系统日期直接执行date命令即可,如果需要调整时间则使用date -s命令:

[root@landian ~]# date -s 03/23/2017 ==>时间顺序为月份、日期、年份Thu Mar 23 00:00:00 CST 2017

5、修改当前系统具体日期也使用date -s命令,顺序为小时、分钟、秒:

[root@landian ~]# date -s 16:47:00Thu Mar 23 16:47:00 CST 2017

6、把时区、日期和具体时间修改之后要保存到BIOS中避免重启系统时间又恢复了:

[root@landian ~]# hwclock -w

上面就是关于Linux系统怎么修改时间的解决方法,有需要的用户们可以采取上面的方法步骤来进行操作吧,相信可以帮助到大家。

人的不幸缘于欲望,所以知足者长乐。

Linux系统怎么修改时间?通过服务器终端执行date命令即可!

相关文章:

你感兴趣的文章:

标签云: