zoukankan      html  css  js  c++  java
  • [转]linux时间同步

    转自:http://www.jotop.com/2012/vpsinfo_0525/439.html

    美国的vps大多都是国外的时间,让我们的程序总是不适应。那么如何调整linux的时间为北京时间?修改linux vps的时间和时区,有什么办法? 首先,需要ssh登录vps或服务器: date 可以查看时间和时区。然后:

    rm -rf /etc/localtime
    ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
      再date看看,是不是时间正确了。如果已经正确,那么OK搞定。 SSH操作范例: root@www.ctohome.com~]# date
    Thu May  6 02:01:52 UTC 2010
    [root@ www.ctohome.com ~]# rm -rf /etc/localtime
    [root@ www.ctohome.com ~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
    [root@ www.ctohome.com ~]# date
    Thu May  6 10:02:32 CST 2010   如果还是有些不对,那么需要用命令 ntpdate stdtime.sinica.edu.tw 来校准时间。 ntpdate stdtime.sinica.edu.tw 如果提示无此命令,那么需要先安装 ntpdate centos 安装方法: yum -y install ntpdate ntp Ubuntu安装方法: sudo apt-get install -y ntpdate ntp 校准后,如果时间还是不对,那么就是其他的问题了。如果是linux vps,那么可能就是母服务器的时间不对,没有办法了。

  • 相关阅读:
    bs4的学习
    mysqldb模块的简单用法
    起点中文网(主要是在目录下创建文件)
    怎么把列表转化为字符串
    GUI开发者桌面搜索文件工具
    用表格形式保存文档 xlwt
    如何解决编码有问题
    影魔
    龙与地下城
    不等关系
  • 原文地址:https://www.cnblogs.com/solohac/p/4154170.html
Copyright © 2011-2022 走看看