ubuntu设置系统时间与网络时间同步和时区
Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC)。
系统时间:指当前Linux Kernel中的时间。
硬件时间:主板上有电池供电的时间。
查看系统时间的命令: #date
设置系统时间的命令: #date –set(月/日/年 时:分:秒)
例:#date –set “10/11/10 10:15”
查看硬件时间的命令: # hwclock
设置硬件时间的命令: # hwclock –set –date = (月/日/年 时:分:秒)
上述提到的是手动设置时间到一个时间点,可能与当前网络的时间有误差。下面介绍一下与时间服务器上的时间同步的方法
1. 安装ntpdate工具
# sudo apt-get install ntpdate
2. 设置系统时间与网络时间同步
# ntpdate cn.pool.ntp.org
3. 将系统时间写入硬件时间
# hwclock --systohc
时区修改
1.首先查看时区:
swfsadmin@swfsubuntu:~$ date -R
Tue, 17 Dec 2013 18:23:01 +0800
如果要修改时区,执行sudo tzselect
2.选择区域:亚洲

swfsadmin@swfsubuntu:~$ sudo tzselect
[sudo] password for swfsadmin:
Sorry, try again.
[sudo] password for swfsadmin:
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
1) Africa
2) Americas
3) Antarctica
4) Arctic Ocean
5) Asia
6) Atlantic Ocean
7) Australia
8) Europe
9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
#? 5

3.选择国家:中国

Please select a country.
1) Afghanistan 18) Israel 35) Palestine
2) Armenia 19) Japan 36) Philippines
3) Azerbaijan 20) Jordan 37) Qatar
4) Bahrain 21) Kazakhstan 38) Russia
5) Bangladesh 22) Korea (North) 39) Saudi Arabia
6) Bhutan 23) Korea (South) 40) Singapore
7) Brunei 24) Kuwait 41) Sri Lanka
8) Cambodia 25) Kyrgyzstan 42) Syria
9) China 26) Laos 43) Taiwan
10) Cyprus 27) Lebanon 44) Tajikistan
11) East Timor 28) Macau 45) Thailand
12) Georgia 29) Malaysia 46) Turkmenistan
13) Hong Kong 30) Mongolia 47) United Arab Emirates
14) India 31) Myanmar (Burma) 48) Uzbekistan
15) Indonesia 32) Nepal 49) Vietnam
16) Iran 33) Oman 50) Yemen
17) Iraq 34) Pakistan
#? 9

4.选择时区:北京时间

Please select one of the following time zone regions.
1) east China - Beijing, Guangdong, Shanghai, etc.
2) Heilongjiang (except Mohe), Jilin
3) central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.
4) most of Tibet & Xinjiang
5) west Tibet & Xinjiang
#? 1

5.确认验证:

The following information has been given: China
east China - Beijing, Guangdong, Shanghai, etc. Therefore TZ='Asia/Shanghai' will be used.
Local time is now: Tue Dec 17 18:22:10 CST 2013.
Universal Time is now: Tue Dec 17 10:22:10 UTC 2013.
Is the above information OK?
1) Yes
2) No
#? 1 You can make this change permanent for yourself by appending the line
TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again. Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Shanghai

改时间参考:
http://5154091.blog.hexun.com/30735220_d.html
修改时间
sudo date -s MM/DD/YY //修改日期
sudo date -s hh:mm:ss //修改时间
在修改时间以后,修改硬件CMOS的时间
sudo hwclock --systohc //非常重要,如果没有这一步的话,后面时间还是不准
http://www.cnblogs.com/php5/archive/2011/02/15/1955432.html
http://os.51cto.com/art/200908/142234.htm
ubuntu设置系统时间与网络时间同步和时区的更多相关文章
- ubuntu设置系统时间与网络时间同步
ubuntu设置系统时间与网络时间同步 Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC). 系统时间:指当前Linux Ker ...
- centos7设置系统时间与网络时间同步
Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC). 系统时间:指当前Linux Kernel中的时间. 硬件时间:主板上有电池供电的时 ...
- Ubuntu时间有误差,设置系统时间与网络时间同步
转载地址:https://blog.csdn.net/qq_33733970/article/details/78823620
- centos7 设置系统时间与网络同步
1.安装ntpdate工具 yum -y install ntp ntpdate 2.设置系统时间与网络时间同步 ntpdate cn.pool.ntp.org 3.将系统时间写入硬件时间 hwclo ...
- 基于【 centos7】二 || 系统时间与网络时间同步
# date // 查看系统时间 #hwclock // 查看硬件时间 # yum -y install ntp ntpdate 安装ntpdate工具 # ntpdate cn.pool.ntp.o ...
- Linux系统将服务器时间与网络时间同步
遇到一种情景,就是多台服务器之间的时间并不是同步的,有的快有的慢,这时候就要用到网络时间了, 登陆到服务器上,输入命令date可以查询服务器的时间,需要同步的时候需要安装ntpdate; 1. 安装 ...
- Linux的本地时间和网络时间同步
Linux本地时间和网络时间不同步,更新了之后,重启还会变回去.可以通过一下方法修改并保存. 1. 安装ntpdate工具 sudo apt-get install ntpdate 2. 设置系统 ...
- [转] 设置linux时间为网络时间
[From] https://blog.csdn.net/weixin_35852328/article/details/79506453 Linux的时间分为System Clock(系统时间)和R ...
- Linux系统运维笔记(一),查看系统版本和设置系统时间
Linux系统运维笔记 查看系统版本和设置系统时间 查看系统版本 lsb_release -a (适用于所有的linux,包括Redhat.SuSE.Debian等发行版,但是在debian下要安装l ...
随机推荐
- yum安装配置mongoDB客户端和服务器端
1,Centos6.X yum安装mongoDB客户端和服务器端; yum -y install mongodb mongodb-server; 基于epel repo.当前的mongoDB的版本为2 ...
- 关于uitableView的Group模式滑动偏移问题
问题: uitableView的group模式自带一个section的headerView,如果不调整,系统就会默认高度,在滑动时就会向下偏移一个单位的scetion高度,我们改变tableView的 ...
- hpux操作系统的关机与重新启动命令
关机 shutdown -hy 0 重新启动: shutdown -ry 0
- tomcat建立虚拟主机
WEB浏览器与WEBserver建立连接后,除了将请求URL中的资源路径发送给WEBserver外,还会将URL中的主机名部分作为HTTP请求消息的Host头发送给WEBserver.比如,在浏览器地 ...
- Android应用程序组件Content Provider在应用程序之间共享数据的原理分析
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6967204 在Android系统中,不同的应用 ...
- STL源代码剖析 读书总结
<<STL源代码剖析>> 侯捷著 非常早就买了这本书, 一直没看, 如今在实验室师兄代码的时候发现里面使用了大量泛型编程的内容, 让我有了先看看这本书的想法. 看之前我对于泛型 ...
- MVC学习 (二) Razor语法
MVC的Model层我理解与三层架构的Molde没有区别,都是作为各个层之间的数据沟通桥梁.但是关于Control和View都有一些与传统webform不同的特性. 这里先学习View里所用到的Raz ...
- ios 添加多个target 管理 多个版本文件
1. 添加一个Target 这里是添加一个Test 项目 这里添加新的target Test与Release 也是同上的操作
- 客户端js判断文件类型和文件大小即限制上传大小
<html> <head> <meta http-equiv="Content-Type" content="text/html; char ...
- RtlInitUnicodeString、IoCreateDevice、IoCreateSymbolicLink、IoDeleteDevice 四个 API 驱动函数的使用
要解释"驱动对象",就得先从 DriverEntry() 说起: 做过C语言开发的都知道程序是从 main() 函数开始执行.在进行 Windows 驱动程序开发的时候没有 mai ...