一.   设置修改时间:

  1. 查看当前时区:
[root@localhost bin]# date -R

Thu,  Mar  :: +

  2. 查看时间和日期:

[root@localhost bin]# date

2019年 03月 28日 星期四 :: CST

  3. 查看硬件时间:

[root@localhost bin]# hwclock --show

  4. 设置当前日期:

[root@localhost bin]# date -s --

  5. 设置硬件时间:

[root@localhost bin]#  hwclock --set --date="2019-3-28 11:41:05"

  6.设置当前时间:

[root@localhost bin]# date -s ::

2019年 03月 28日 星期四 :: CST

  7.将当前时间写入BIOS, 防止重启失效

[root@localhost bin]# hwclock –w

  8. 替换系统时区时间:

  设置中国时区使用重庆时间

[root@localhost bin]# cp /usr/share/zoneinfo/Asia/Chongqing /etc/localtime 

二.   时间同步:

  1. 系统和硬件时间相互同步:
[root@localhost bin]#  hwclock –hctosys  #硬件时间写入到系统时间

[root@localhost bin]#  hwclock –systohc  #软件时间写入到硬件时间

  2. 同步网络上的时间:

a) 同步网络时间需要安装ntpdate时间同步服务软件;
b) 检查本机是否安装ntpdate [root@localhost ~]# yum list installed | grep ntpdate
[root@localhost ~]# rpm -qa |grep ntpd* c) 使用yum安装ntpdate [root@localhost ~]# yum install -y ntpdate d) 选择服务器同步时间, 可用的服务器有下面几个:
time.nist.gov
time.nuri.net
.asia.pool.ntp.org
.asia.pool.ntp.org
.asia.pool.ntp.org
.asia.pool.ntp.org
[root@localhost ~]# ntpdate time.nist.gov #同步时间服务器

三.   添加定时任务, 同步时间:

a)         每隔一小时同步网络时间

[root@localhost ~]# #* */ * * * root ntpdatetime.nuri.net;hwclock -w

0002_20190328_Centos修改系统时间的更多相关文章

  1. linux下修改系统时间

    一.查看时间: [root@localhost ~]# date2016年 11月 19日 星期六 12:46:37 CST 二.修改时间,修改系统时间 [root@localhost ~]# dat ...

  2. Linux下修改系统时间并写入BIOS

    我们一般使用“date -s”命令来修改系统时间.比如将系统时间设定成2005年7月26日的命令如下. #date -s 07/26/2005 将系统时间设定成下午11点12分0秒的命令如下. #da ...

  3. Wince修改系统时间问题

           当我们需要修改到系统时间的时候,需要用到下面四个函数:SetLoaclTime,GetLocalTime,SetSystemTime,GetSystemTime.这四个函数是用来修改或者 ...

  4. Linux怎样修改系统时间

    修改linux的时间可以使用date指令 修改日期: 时间设定成2009年5月10日的命令如下: #date -s 05/10/2009 修改时间: 将系统时间设定成上午10点18分0秒的命令如下. ...

  5. linux修改系统时间date命令加clock -w

    http://m.jb51.net/LINUXjishu/117784.html 修改linux系统时间的方法(date命令) 11-18 23:22:27作者:脚本之家 命令格式为: date -s ...

  6. CentOS修改系统时间

    CentOS修改系统时间 操作: 1. date –s '1987-05-02 10:10:10' 2. clock –w //将日期写入CMOS 补充: 修改Linux时间一般涉及到3个命令: 1. ...

  7. C#技术点--修改系统时间

    C#的System.DateTime类提供了对日期时间的封装,用它进行时间的转换和处理很方便,但是我没有在其中找到任何可以用来修改系统时间的成员.用过VC.VB等的朋友可能知道,我们可以调用Win32 ...

  8. ubuntu16.4下使用QT修改系统时间

    我也是在网上找的,自己随便改了一下六个lineEdit控件,每个控件输入日期时间,点击按钮触发函数可修改时间. 1 //一键修改系统时间 QString year = ui->lineEdit_ ...

  9. ubantu/centos修改系统时间

    前言:有时系统上的时间和真实的时间对应不是,或者有特殊需求,需要修改系统时间.但是对应多台的服务器系统更改时间,手动的话很麻烦,这就需要写脚本或者搭建时间服务器了,统一时间,以下是对于一个不同系统修改 ...

随机推荐

  1. zoj Candies 思维

    http://acm.zju.edu.cn/changsha/showProblem.do?problemId=31 题意: 给你n个非负整数,然后输入n个x[i],x[i] == -1表示第i个数不 ...

  2. codeforces 11 B.Jumping Jack 想法题

    B. Jumping Jack Jack is working on his jumping skills recently. Currently he's located at point zero ...

  3. domain---Node.js 异步异常的处理与domain模块解析

    var domain = require('domain'); app.use(function (req, res, next) { var reqDomain = domain.create(); ...

  4. python re 正则表达式复习

    正则表达式是一种小巧的独立语言,用于字符串的匹配 一.元字符 1.. 匹配除换行符外的任意字符 2.^ 匹配字符串开头 3.$ 匹配字符串末尾 4.* 匹配前一字符n次 5.+ 匹配前一字符1-n次 ...

  5. 在页面和请求中分别使用XML Publisher生成PDF报表且自动上传至附件服务器

    两个技术要点: 1.使用TemplateHelper.processTemplate方法生成目标PDF的InputStream流,再使用ftp中上传流的方法将其上传至附件服务器. 2.在请求中调用AM ...

  6. Arachni web扫描工具

    扫描工具-Arachni from:https://blog.csdn.net/zixuanfy/article/details/52818527 ./arachni_console         ...

  7. windows update失败还原更改,无法开机

    转自  http://jingyan.baidu.com/article/59a015e34c5a73f794886520.html?tj=exp_relate_3&st=2&from ...

  8. Leetcode 1024. Video Stitching

    class Solution: def helper(self,l,r,clips)->int: maxL,maxR=0,0 iL,iR=-1,-1 for i,c in enumerate(c ...

  9. HDU 3746

    http://acm.hdu.edu.cn/showproblem.php?pid=3746 kmp的Nxet数组求字符串循环节例题 lenB%(lenB-Next[lenB])==0则其有周期len ...

  10. goldendict

    linux下的翻译词典,可以添加在线和离线词典,比window下的有道感觉强的不止100倍. 点击编辑—>dictionary,可以添加在线和离线词典,最好添加离线的把,我添加了好多在线的,go ...