linux下时区设置和时间同步
一、时区设置:
[root@master ~]# tzselect Please identify a location so that time zone rules can be set correctly. Please select a continent or ocean.1) Africa2) Americas3) Antarctica4) Arctic Ocean5) Asia6) Atlantic Ocean7) Australia8) Europe9) Indian Ocean 10) Pacific Ocean 11) none - I want to specify the time zone using the Posix TZ format. #? 5 Please select a country.1) Afghanistan 18) Israel 35) Palestine2) Armenia 19) Japan 36) Philippines3) Azerbaijan 20) Jordan 37) Qatar4) Bahrain 21) Kazakhstan 38) Russia5) Bangladesh 22) Korea (North) 39) Saudi Arabia6) Bhutan 23) Korea (South) 40) Singapore7) Brunei 24) Kuwait 41) Sri Lanka8) Cambodia 25) Kyrgyzstan 42) Syria9) 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 Please select one of the following time zone regions. 1) Beijing Time 2) Xinjiang Time #? 1The following information has been given:ChinaBeijing TimeTherefore TZ='Asia/Shanghai' will be used. Local time is now: Sun Apr 15 09:16:02 CST 2018. Universal Time is now: Sun Apr 15 01:16:02 UTC 2018. Is the above information OK? 1) Yes 2) No #? 1You can make this change permanent for yourself by appending the lineTZ='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 You have new mail in /var/spool/mail/root
然后再配置环境变量
[root@master ~]# vi /etc/profile###NTP export TZ='Asia/Shanghai'
然后reboot
看下时间,我用的是CST(china-shanghai) ,没用UTC , UTC是世界协调时间,比北京时间晚8个小时
[root@master ~]# date Sun Apr 15 09:18:01 CST 2018
二、 时间同步:
[root@master ~]# ntpdate ntp1.aliyun.com 15 Apr 09:21:06 ntpdate[2557]: adjust time server 182.92.12.11 offset -0.088385 sec
三、其他
如果想保证时间更精确,可以在局域网内设置一个服务器采用上述方式获取时间。
然后将其他的 服务器同步此台服务器的时间。
该方式请参看 https://blog.csdn.net/leys123/article/details/52937114
转载于:https://www.cnblogs.com/zhangmin1987/p/8845868.html
linux下时区设置和时间同步相关推荐
- 【Linux】Linux服务器时区设置和时间同步
我们在安装Linux服务器的时候,可能会为了图方便,直接安装为系统默认的时区和语言,比如英语.但是,当系统安装启动后,我们会发现系统的时间是12小时制,这个与我们习惯的24小时制有一定的区别,看系统时 ...
- linux进行校时ntp,Linux下快速搭建ntp时间同步服务器
Linux下快速搭建ntp时间同步服务器 背景: 服务器多了,时间是否一致以及是否准备就显得格外重要,虽然这个问题总是被忽略,但是统一时间是很有必要的,因为时间问题导致服务出现问题也是司空见惯,本文简 ...
- linux设置定时备份任务,Linux下Oracle设置定时任务备份数据库的教程
1.查看数据库的字符集 数据库的字符集必须和linux下设置的环境变量一致,不然会有乱码. 以下两个sql语句都可以查到: select * from nls_database_parameters ...
- linux系统时区设置
linux系统时区设置 - 系统时钟设置 格式:date 月/日时:分:年.秒 [root@localhost ~]# date 080319462010.55 二 8月 3 19:46:55 C ...
- oracle定时任务可以备份么,Linux下Oracle设置定时任务备份数据库的教程
1.查看数据库的字符集 数据库的字符集必须和Linux下设置的环境变量一致,不然会有乱码. 以下两个sql语句都可以查到: select * from nls_database_parameters ...
- linux 的时区设置函数tzset()
linux 的时区设置函数tzset() 标签: linuxtimezonevariablesdstnullwindows 2010-01-26 15:27 7482人阅读 评论(0) 收藏 举报 ...
- linux下阻塞的系统调用,Linux下socket设置为非阻塞方式和fcntl系统调用.pdf
Linux 下 socket 设置为非阻塞方式和 fcntl 系统调用 [ 日期: 2011-04-16] 来源: Linux 社区 作者: Linux 用以下方法将 socket 设置为非阻塞方式 ...
- Linux服务器时区设置
首先要知道有Linux服务器有2种时钟类型 1.硬件时钟(RTC time) 可以通过hwcolock或clock命令操作硬件时钟通过date修改时间,当系统下次重启时,系统时钟还会从硬件时钟去取 ...
- arm linux修改时区设置
arm linux 通过NTP对时之后,终端命令行Date命令显示的时间是对的,但是web服务器中的时间还是差8H.之前是通过export TZ=CST-8 修改的系统时区. 最后通过增加: ./et ...
最新文章
- 怎样在VirtualBox 虚拟机中挂载共享目录
- CentOS安全配置(转)
- 关于Discuz X2 论坛备份详解(论坛搬家)
- php setcookie使用变量,PHP setcookie() 函数
- Vue005_ 列表渲染
- Visual C# 2008+SQL Server 2005 数据库与网络开发-- 5.1 计算
- POJ 2923 Relocation(状压DP)题解
- 网件刷breed_斐讯K2刷不死breed加padavan华硕固件教程
- 四阶龙格库塔matlab计算例题,四阶龙格库塔法matlab实现
- lazarus 中文教程_Lazarus中文版下载|Pascal编译器Lazarus下载 v1.6.0中文版(附使用教程)_星星软件园...
- uniapp运行到微信小程序开发工具
- CSS3-3D动画制作旋转立方体
- html5拼图游戏canvas,canvas拼图游戏
- 利用opencv-python 进行图像的不规则裁剪
- 搜狗搜索立知问答合作说明
- AD怎么输入坐标_CAD入门基础小知识(二)捕捉栅格绘制直线amp;使用坐标绘图...
- 僵尸进程(Zombie process )
- spring boot自动化配置
- 什么是apache服务器
- Python包管理工具PIP常用命令详解