linux时钟基本概念、CST与UTC、以及NTP简单设置
1,安装linux的时候在设置时间的时候有一个选项:
system clock uses UTC,那么这个UTC是什么意思呢?
世界协调时间(Universal Time Coordinated,UTC)
GPS 系统中有两种时间区分,一为UTC,另一为LT(地方时)两者的区别为时区不同,UTC就是0时区的时间,地方时为本地时间,如北京为早上八点(东八区),UTC时间就为零点,时间比北京时晚八小时,以此计算即可
2,在linux中,用date查看时间的时候显示:
2008年 12月 17日 星期三 09:04:14 CST
这个CST是什么意思呢?
CST China Standard Time UTC+8:00 中国沿海时间(北京时间)
############################################
以下内容是关于帮助你在linux下设置日期和时间的一些步骤,也包含了一点ntpd时间同步的内容。特别提醒的是在发行版本的限制是red hat系列,包括fedora,centos,redflag,unbreakable linux等。
There
are two clocks to configure in Linux, the hardware clock and the system
clock. The hardware clock determines the system clock on system boot.
While the system is running, changes to one of these doesn't affect the
other.
在linux下有两个时钟需要配置,硬件时钟和系统时钟。硬件时钟在系统启动时决定系统时钟,当系统处于运行状态下时,修改其中任何一个并不能对另一个默认生效。
Note:
it's best to set the hardware clock and have the system clock be set
upon a reboot. Changing the system clock by using the date program on a
running system could cause date discontinuities and consequently
problems. If you will be using ntpd, you probably don't need to set
either of these clocks (unless the current time is more than 1000s off
the real time). Just setup ntpd and let ntpd adjust the time (it will do
it in small steps to keep system timestamps reliable).
- 现在大部分的发行版本在图形界面下都提供了时钟设置工具,例如kde,gnome都有友好的 图形化工具,这里就不多说了。
- You
can use timeconfig to configure the timezone and UTC settings.
Timeconfig will update /etc/sysconfig/clock and /etc/localtime. - Set the time zone manually if not already set.
Linux
uses the file /etc/localtime to determine the time zone. This file
should be either a copy of the appropriate timezone file from the
directory /usr/share/zoneinfo or a symbolic link. If your time zone is
incorrect, create a symbolic link to the appropriate timezone file.# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
- Set whether hwclock uses local time or UTC
Edit
the file /etc/sysconfig/clock and change "UTC=" to true or false. If
you have a dual-boot system with Windows, using UTC may cause problems
for Windows. - Set the system clock
# date MMDDhhmmCCYY.ss
where MM is month, DD is day, hh is hour, mm is minutes, CCYY is year and ss is seconds. Time should be in 24-hour notation.
To only set the time:
# date -s hh:mm:ss
- Set the hardware clock
To set the hardware clock to the current system clock:
# setclock
this method looks at /etc/sysconfig/clock to determine whether the hardware clock is set to UTC
Another method:
# hwclock --systohc
# hwclock --systohc --utcuse the second option if you use UTC.
Set hwclock manually:
# hwclock --set --date="9/22/96 16:45:05"
Everytime you use the hwclock --set command, it will create or edit the file /etc/adjtime to determine the systematic drift. Once you have some history, you can use the --adjust option to adjust the hardware clock appropriately. Run as a cron job if you want the clock to adjust automatically on a regular schedule. Don't use the --adjust function when using ntpd since ntpd will turn the "11 minute mode" on, which is best left alone. See the hwclock manpage for more info.
- Setup ntpd for automatic synchronization with a remote server.
Run Red Hat's setup utility to make ntpd start on boot up and edit /etc/ntp.conf
Set server and fudge options:
server time.nist.gov
fudge time.nist.gov stratum 10Enable multicastclient:
multicastclient # listen on default 224.0.1.1
Edit /etc/sysconfig/ntpd if necessary. The default should be fine.
Start the ntpd daemon:
# service ntpd start
linux时钟基本概念、CST与UTC、以及NTP简单设置的更多相关文章
- linux时钟概念CST与UTC、以及NTP简单设置
1.世界协调时间(Universal Time Coordinated,UTC): GPS 系统中有两种时间区分,一为UTC,另一为LT(地方时)两者的区别为时区不同,UTC就是0时区的时间,地方时为 ...
- Linux/CentOS下的CST和UTC时间的区别以及不一致的解决方法
今天被我遇到了,相差八小时,,,tzselect过了都不行,还得用ntupdate核一下. 网上找的,备不时之需要. ~~~~~~~~~~~~~~~~ 1.在linux中,用date查看时间的时候显示 ...
- Linux负载均衡概念与实践(一)
根据网上文章整理. 负载均衡软件LVS(Linux Virtual Server)概念篇 lvs是在linux操作系统基础上建立虚拟服务器,实现服务节点之间的负载均衡.它是基于linux内核实现的.2 ...
- Linux(二)—— Unix&Linux 的基本概念
Linux(二)-- Unix&Linux 的基本概念 计算机 = 主机(host)+ 终端(terminal) 主机 = 内核 + 实用工具 内核(kernel) 当计算机启动时,计算机要经 ...
- linux信号基本概念及如何产生信号
linux信号基本概念及如何产生信号 摘自:https://blog.csdn.net/summy_j/article/details/73199069 2017年06月14日 09:34:21 阅读 ...
- Linux的防火墙概念
#linux的防火墙概念#因为如果你不关防火墙,很可能运行 django.nginx.mysql出错#防火墙可能会阻挡端口流量的 出口#也会阻挡外来请求的 入口 #selinux iptables f ...
- Linux 集群概念 , wsgi , Nginx负载均衡实验 , 部署CRM(Django+uwsgi+nginx), 部署学城项目(vue+uwsgi+nginx)
Linux 集群概念 , wsgi , Nginx负载均衡实验 , 部署CRM(Django+uwsgi+nginx), 部署学城项目(vue+uwsgi+nginx) 一丶集群和Nginx反向代理 ...
- Linux下Jdk的安装和jdk环境变量的设置
我们在Linux下安装系统软件的时候,经常遇到一些系统环境变量配置的问题.什么是环境变量?如何定制环境变量?我将在下面做一些介绍.一.什么是环境变量?Linux是一个多用户的操作系统.多用户意味着每个 ...
- Linux服务器,服务管理--systemctl命令详解,设置开机自启动
Linux服务器,服务管理--systemctl命令详解,设置开机自启动 syetemclt就是service和chkconfig这两个命令的整合,在CentOS 7就开始被使用了. 摘要: syst ...
随机推荐
- 写出易调试的SQL—西科软件
1.前言 上篇 写出易调试的SQL , 带来了一些讨论, 暴露了不能重用执行计划和sql注入问题, 十分感谢园友们的建议 . 经过调整后 ,将原来的SQLHelper 抓SQL 用做调试环境用, 发布 ...
- SQL SERVER 分页查询
Sqlserver数据库分页查询一直是Sqlserver的短板. 但现在不是了. 自从有了它. 一口气上十楼. 官方语法说明示例: https://technet.microsoft.com/zh-c ...
- shell编程之流程控制
-d 判断该文件是否存在,并且是否为目录文件 -e 判断该文件是否存在 -f 判断该文件是否存在,并且是否为普通文件 形式 [ -e /home/cao/test.txt ] -r 文件 判断该文 ...
- 关于yii2框架活动记录activeRecord添加默认字段的问题
平时使用sql的时候可以如下添加默认字段flag: "select a.*,0 as flag from user_info a", 对于yii2框架则需要这样: $query = ...
- Nginx-->基础-->理论-->001:Nginx基本介绍
一.nginx基本介绍 传统上基于进程或者线程模型架构的web服务通过每进程或者每线程处理并发连接请求,这势必毁在网络和I/O操作时产生阻塞,其另外一个必然结果则是对内存和CPU的利用率低下,产生一个 ...
- solr 中文分词 IKAnalyzer
solr中文分词器ik, 推荐资料:http://iamyida.iteye.com/blog/2220474?utm_source=tuicool&utm_medium=referral 使 ...
- 数据库事务中的隔离级别和锁+spring Transactional注解
数据库事务中的隔离级别和锁 数据库事务在后端开发中占非常重要的地位,如何确保数据读取的正确性.安全性也是我们需要研究的问题.ACID首先总结一下数据库事务正确执行的四个要素(ACID): 原子性(At ...
- EF6配合MySQL或MSSQL(CodeFirst模式)配置指引
一.新建一个解决方案,包含两个项目:EF6CodeFirstMySQL.Model(动态库项目),EF6CodeFirstMySQL.Tests(控制台应用) 二.通过NuGet将EntityFram ...
- 如何系统地自学一门Python 语言(转)
转自:http://www.phpxs.com/post/4521 零基础情况下,学一门语言充实下自己,Python,简洁.优美.容易使用,是一个很好的选择.那么如何系统地自学Python呢? 有的人 ...
- JavaSE基础知识总结
最近回顾了一下Java的基础知识,决定写成博客梳理一遍,主要是JavaSE部分最基础的知识,适合考前突击,学后回顾,不适合作为初学材料. 简单的列个目录吧: 一.数据类型和运算符 二.流程控制与数组 ...