用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时间时区设置的更多相关文章

  1. linux 的时区设置函数tzset() 【转】

    linux 的时区设置函数tzset() 本文转载于: http://blog.csdn.net/epicyong333/article/details/5258152 tzset #incude & ...

  2. Linux时间时区详解与常用时间函数

    时间与时区 整个地球分为二十四时区,每个时区都有自己的本地时间. Ø  UTC时间 与 GMT时间 我们可以认为格林威治时间就是时间协调时间(GMT = UTC),格林威治时间和UTC时间都用秒数来计 ...

  3. linux时间校准 设置时间为上海时区

      [root@localhost log]# rm -f /etc/localtime [root@localhost log]# cp /usr/share/zoneinfo/Asia/Shang ...

  4. Linux 时间时区同步

    $ sudo cp /usr/share/zoneinfo/Asia/ShangHai /etc/localtime 上述是修改系统时区 同步时间 1.  安装ntpdate工具 $ sudo apt ...

  5. linux时间校准设置,解决与本地时间不一致问题

    时间安装脚本   从NTP上把时间同步到本地 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 更新本地时间 ntpdate us.pool.nt ...

  6. Linux时间不准确的问题![转]

    Linux时间不准确的问题![转] 安装完系统发现时间与现实时间相差+8小时,经分析由以下产生.我们在安装时选择的是上海,而centos5把bios时间认为是utc时间,所以+8小时给我们.这个时候的 ...

  7. Linux 时间及时区设置

    时间以及时区设置 by:授客 QQ:1033553122 1.首先确认使用utc还是local time. UTC(Universal Time Coordinated)=GMT(Greenwich ...

  8. linux下的时间及时区设置

    一.时间设置及同步 1修改系统时间 #date -s 06/18/14 #date -s 14:20:50 2命令查看.设置硬件时间 #hwclock  --show 或者clock  --show ...

  9. 关于linux中的时间 时区问题

    本文部分来源于:  http://hi.baidu.com/peruke/blog/item/b8de06ec6a04583b27979132.html 系统是fedora: glibc实现了从RTC ...

随机推荐

  1. 临时表之IF-ELSE

    1.解决输出单列到临时表 场景:存储过程传入id,id为缺省的过滤条件,如果id为0,则查找出tt表中的所有id作为过滤条件 目的:id不为0时,过滤id 解决:用case when来代替if els ...

  2. 利用javascript对提交数据验证

    优点:提交前验证.在客户端进行. <html> <head> <script language="javascript"> function c ...

  3. oracle:db-link使用

    二个oracle instance,如果需要在一个instance上,直接查询另一个instance上的数据,就要用到db-link 创建: create public database link 链 ...

  4. FineUI v4.0.3 (beta) 和 FineUI v3.3.3 发布了!

    关于FineUI基于 ExtJS 的开源 ASP.NET 控件库 FineUI的使命创建 No JavaScript,No CSS,No UpdatePanel,No ViewState,No Web ...

  5. 理解JavaScript中的参数传递 - leetcode189. Rotate Array

    1.关于leetcode 这是第一篇关于leetcode的题解,就先扯点关于leetcode的话. 其实很早前就在博客园看到过leetcode一些题解,总以为跟一般OJ大同小异,直到最近点开了一篇博文 ...

  6. 初学git:用git bash往github push代码

    对于我来说,最开始使用github主要是为了使用它的pages功能展示demo.其实这些都是用Github for Windows push上去的,图形化界面的客户端使用确实简单,但是逼格不够,好吧其 ...

  7. .Net简单图片系统-简介

    系统简介 最近做了一个简单图片系统,这个系统就是 将上传的的图片保存到系统本地文件系统或者基于fastdfs的分布式文件系统中,在查看图片时会直接请求此系统或者fastdfs的tracker服务器(需 ...

  8. MVC认知路【点点滴滴支离破碎】【三】----IIS7.5上部署MVC4.0

    发布web到iis不能运行Google   ----- ╲ http://stackoverflow.com/questions/12057540/installing-asp-net-mvc-4-o ...

  9. impdp导入时卡死分析方法

    来源于: http://blog.csdn.net/yfleng2002/article/details/7973997 http://www.cnblogs.com/songling/archive ...

  10. ( 转 ) Android自绘字体大小paint.settextsize随分辨率大小变化

    1.获取当前设备的屏幕大小 DisplayMetrics displayMetrics = new DisplayMetrics(); this.getWindowManager().getDefau ...