linux校验时间
一. 基本方法:
date -s "2018-09-02 04:23:45"
clock -w 把时间写入cmos(一个RAM芯片)
hwclock 查看硬件时间
hwclock -w :将系统时间写入硬件时间
hwclock --hctosys: 将系统时间调整为和硬件时间一样
hwclock --systohc: 将硬件时间调整为和系统时间一样
例如:在设置中国时区使用亚洲/上海(+8)
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
将UTC时间改为CST格式
/etc/profile末尾添加一行
export TZ='CST-8'
然后执行 source /etc/profile 使文件生效
或者 dpkg-reconfigure tzdata
rdate -t -s stdtime.gov.hk #使用rdate将stdtime.gov.hk服务器的时间抓取回来
hwclock -w #将获得的时间写入硬件
rdate的命令使用方法介绍
linux校验时间的更多相关文章
- Linux下时间格式转换及获取方法
Linux下使用clock_gettime给程序计时 #include <stdio.h> #include <unistd.h> #include <stdlib.h& ...
- LINUX 下时间转换为秒数
linux下时间是从1970.1.1开始算的秒数 //转来自网址 http://blog.csdn.net/wind19/article/details/6579495 $ dateTue Feb 3 ...
- linux修改时间
1.修改linux系统时间 [root@localhost ~]# date -s "2016-10-15 13:15:12" 2.将系统时间和网络服务器时间同步 [root@lo ...
- java校验时间格式 HH:MM
package com; import java.text.SimpleDateFormat; import java.util.Date; /** * @author Gerrard */ publ ...
- Linux_自动调整linux系统时间和时区与Internet时间同步
调整linux系统时间和时区与Internet时间同步 一.修改时区:# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime修改为中国的东八区# v ...
- 修改linux系统时间的方法(date命令)
修改linux系统时间的方法(date命令) 来源:互联网 作者:佚名 时间:11-18 23:22:27 [大 中 小] date命令不仅可以显示系统当前时间,还可以用它来修改系统时间,下面简单的介 ...
- linux硬件时间修改与查看
linux修改时间和日期.查看修改硬件时间 Linux时钟分为系统时钟(System Clock)和硬件(Real Time Clock,简称RTC)时钟.系统时钟是指当前Linux Kernel中的 ...
- Linux操作系统时间与BIOS硬件时间
注:以Ubuntu为例说明 在Linux计算机上,有两个时间,一个是硬件时间(BIOS中记录的时间,称为hwclock),另一个是操作系统时间(osclock).硬件时钟由BIOS电池供电, 当计算机 ...
- Linux文件时间属性
Linux文件时间属性 ...
随机推荐
- Xbuild
https://github.com/zhuayi/xbuild
- 398. Random Pick Index随机pick函数
[抄题]: Given an array of integers with possible duplicates, randomly output the index of a given targ ...
- 606. Construct String from Binary Tree 从二叉树中构建字符串
[抄题]: You need to construct a string consists of parenthesis and integers from a binary tree with th ...
- 基于HTML5的RDP访问实战
基于HTML5的RDP访问实战 1.安装guacamole 2.下载源码 3.安装服务端 安装报错 错误 参考 http://www.remotespark.com/html5.html ...
- 启动redis注意事项
1.需要修改配置文件 redis.conf 三处 a.将bind 127.0.0.0 修改为 bind 0.0.0.0 b.daemonize no 修改为 daemonize ...
- CentOS 6.5 下安装 Sun JDK 1.7
下载 http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html 得到 jdk-7u51-l ...
- Jenkins持续集成构建
配置Sonar.Jenkins进行持续审查 http://go2live.cn/archives/38261.html Jenkins iOS 项目持续集成 http://go2live.cn/arc ...
- extends注意事项
属性可以在子类中被调用,而局部变量不可以
- WireShark抓包的pcap文件格式分析
http://www.360doc.com/content/14/0220/11/15257968_354157537.shtml http://www.360doc.com/content/14/0 ...
- Mysql简介与编译安装
==========MYSQL工作原理图: 1>数据库简介:简单的说数据库(database)就是一个存储数据的仓库,它将数据按照特定的规律存储到磁盘上,通过数据库管理系统,能够有效的管理存储在 ...