zoukankan      html  css  js  c++  java
  • linux时间时区设置

      用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 #设置硬件为本地时

    本文源自http://www.cnblogs.com/makefile/
  • 相关阅读:
    约瑟夫环-我的解答与迷宫
    数据结构实验一
    typedef struct 是什么意思
    编程名言名句
    创建单链表
    离散实验一
    Angela Merkel poised for record poll win and historic third term
    我的生活计划-贵在执行,贵在坚持
    考研经验
    2010年河南省普通高校招生本科一批院校 平行投档分数线(理科)
  • 原文地址:https://www.cnblogs.com/makefile/p/3561115.html
Copyright © 2011-2022 走看看