0002_20190328_Centos修改系统时间
一. 设置修改时间:
- 查看当前时区:
[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
二. 时间同步:
- 系统和硬件时间相互同步:
[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修改系统时间的更多相关文章
- linux下修改系统时间
一.查看时间: [root@localhost ~]# date2016年 11月 19日 星期六 12:46:37 CST 二.修改时间,修改系统时间 [root@localhost ~]# dat ...
- Linux下修改系统时间并写入BIOS
我们一般使用“date -s”命令来修改系统时间.比如将系统时间设定成2005年7月26日的命令如下. #date -s 07/26/2005 将系统时间设定成下午11点12分0秒的命令如下. #da ...
- Wince修改系统时间问题
当我们需要修改到系统时间的时候,需要用到下面四个函数:SetLoaclTime,GetLocalTime,SetSystemTime,GetSystemTime.这四个函数是用来修改或者 ...
- Linux怎样修改系统时间
修改linux的时间可以使用date指令 修改日期: 时间设定成2009年5月10日的命令如下: #date -s 05/10/2009 修改时间: 将系统时间设定成上午10点18分0秒的命令如下. ...
- linux修改系统时间date命令加clock -w
http://m.jb51.net/LINUXjishu/117784.html 修改linux系统时间的方法(date命令) 11-18 23:22:27作者:脚本之家 命令格式为: date -s ...
- CentOS修改系统时间
CentOS修改系统时间 操作: 1. date –s '1987-05-02 10:10:10' 2. clock –w //将日期写入CMOS 补充: 修改Linux时间一般涉及到3个命令: 1. ...
- C#技术点--修改系统时间
C#的System.DateTime类提供了对日期时间的封装,用它进行时间的转换和处理很方便,但是我没有在其中找到任何可以用来修改系统时间的成员.用过VC.VB等的朋友可能知道,我们可以调用Win32 ...
- ubuntu16.4下使用QT修改系统时间
我也是在网上找的,自己随便改了一下六个lineEdit控件,每个控件输入日期时间,点击按钮触发函数可修改时间. 1 //一键修改系统时间 QString year = ui->lineEdit_ ...
- ubantu/centos修改系统时间
前言:有时系统上的时间和真实的时间对应不是,或者有特殊需求,需要修改系统时间.但是对应多台的服务器系统更改时间,手动的话很麻烦,这就需要写脚本或者搭建时间服务器了,统一时间,以下是对于一个不同系统修改 ...
随机推荐
- HDU 1698 Just a Hook(线段树:区间更新)
http://acm.hdu.edu.cn/showproblem.php?pid=1698 题意:给出1~n的数,每个数初始为1,每次改变[a,b]的值,最后求1~n的值之和. 思路: 区间更新题目 ...
- Android -- service的开启方式, start开启和绑定开启服务,调用服务的的方法, aidl调用远程服务
1. 概述 bindService() 绑定服务 可以得到服务的代理人对象,间接调用服务里面的方法. 绑定服务: 间接调用服务里面的方法. 如果调用者activity被销毁了, ...
- python assert 断言详细用法格式
使用assert断言是学习python一个非常好的习惯,python assert 断言句语格式及用法很简单.在没完善一个程序之前,我们不知道程序在哪里会出错,与其让它在运行最崩溃,不如在出现错误条件 ...
- lua if 流程控制
Lua认为false和nil为假,true和非nil为真. 要注意的是Lua中 0 为 true --[ 为 true ] ) then print("0 为 true") end ...
- 模拟函数调用 Simulation Exclusive Time of Functions
2018-04-28 14:10:33 问题描述: 问题求解: 个人觉得这是一条很好的模拟题,题目大意就是给了一个单线程的处理器,在处理器上跑一个函数,但是函数里存在调用关系,可以是调用其他函数,也可 ...
- (GoRails) Credential
之前的博客:https://www.cnblogs.com/chentianwei/p/9167489.html Guide: https://guides.rubyonrails.org/secu ...
- vue 子组件传递数据跟父组件
子组件 <body> <div v-on:click="test"></div> <script> export default { ...
- prototype原型模式
/** * 原型模式 Prototype * 用原型实例指定创建对象的种类,并通过拷贝这些原型创建新的对象 */ 需求: public class Resume { /** * 要求:一个简历类,必须 ...
- java基础11天
冒泡排序 相邻元素两两比较,大的往后放,第一次完毕,最大值出现在了最大索引处,第二次比较厚,最大值放在了倒数第二的位置,一直到第二个元素确定了,整个数组的顺序也就确定了 public class Ar ...
- 《转》深入理解Activity启动流程(二)–Activity启动相关类的类图
本文原创作者:Cloud Chou. 出处:本文链接 本系列博客将详细阐述Activity的启动流程,这些博客基于Cm 10.1源码研究. 在介绍Activity的详细启动流程之前,先为大家介绍Act ...