首页 > 其他 > 详细

linux时间时区设置

时间:2014-02-23 05:11:07      阅读:352      评论:0      收藏:0      [点我收藏+]

  用linux的时候大家可能会遇到时间不对,时区不对的情况。比如使用网上廉价的国外的linux的vps,时区是国外的。那么如何在不劳烦管理员的情况下自己动手呢?首先要了解硬件时钟与系统时钟,计算机上的BIOS时间,这还得google一番,详情可参见http://kerrigan.sinaapp.com/post-6.html。当然了对于咱们来说会几个命令就行了:
hwclock -s --localtime

让硬件时间使用本地时间即可。
[root@remote ~]# hwclock --help
hwclock - query and set the hardware clock (RTC)

Usage: hwclock [function] [options...]
这里需要大家特别注意:先是函数后是参数,只用其中一个是没有用的,这是解决问题的关键

Functions:
-r | --show read hardware clock and print result #读取硬件(BIOS)时间,并显示出来
-s | --hctosys set the system time from the hardware clock #把目前系统时间调整为硬件时间
-w | --systohc set the hardware clock to the current system time #把硬件时间调整为目前系统的时间
--systz set the system time based on the current timezone #把系统时间设置为当时时区的时间

Options:
-u | --utc the hardware clock is kept in UTC #设置硬件为的UTC时间
  --localtime the hardware clock is kept in local time #设置硬件为本地时

linux时间时区设置

原文:http://www.cnblogs.com/makefile/p/3561115.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!