解决系统时间与硬件时钟错误
2015-09-24 11:42
197 查看
错误代码:
#date ###查看系统日期显示日期是前几天
解决方法:
与时间服务器进行时间同步
#ntpdate time.nist.gov
设置时区为东八区
#rm -rf /etc/localtime
#ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
将硬件时间同步为系统时间
#hwclock --systohc
vim /etc/sysconfig/clock 文件里可以看到时区设置和是否启用时区转换的选项
PS:
当Linux启动时,系统时钟会去读取硬件时钟的设定,之后系统时钟即独立运作。
hwclock命令:
-r, --show 读取并打印硬件时钟(read hardware clock and print result )
-s, --hctosys 将硬件时钟同步到系统时钟(set the system time from the hardware clock )
-w, --systohc 将系统时钟同步到硬件时钟(set the hardware clock to the current system time )
本文出自 “珞辰的博客” 博客,请务必保留此出处http://luochen2015.blog.51cto.com/9772274/1697765
#date ###查看系统日期显示日期是前几天
解决方法:
与时间服务器进行时间同步
#ntpdate time.nist.gov
设置时区为东八区
#rm -rf /etc/localtime
#ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
将硬件时间同步为系统时间
#hwclock --systohc
vim /etc/sysconfig/clock 文件里可以看到时区设置和是否启用时区转换的选项
PS:
当Linux启动时,系统时钟会去读取硬件时钟的设定,之后系统时钟即独立运作。
hwclock命令:
-r, --show 读取并打印硬件时钟(read hardware clock and print result )
-s, --hctosys 将硬件时钟同步到系统时钟(set the system time from the hardware clock )
-w, --systohc 将系统时钟同步到硬件时钟(set the hardware clock to the current system time )
本文出自 “珞辰的博客” 博客,请务必保留此出处http://luochen2015.blog.51cto.com/9772274/1697765
相关文章推荐
- POJ 1382 Cover The Island
- Python之序列化
- Chrome 插件项目
- CentOS+Nginx+PHP+MySQL 搭建高性能的web服务器
- PullToRefreshScrollView下拉刷新、上啦加载更多、里面并解决与ListView数据加载问题(需要PullToReFerensh库)
- 在eclipse导入Java的jar包的方法JDBC(图文说明)
- 修改apache的默认用户和组
- 在Mac OS X上安装 Ruby运行环境 CocoaPods安装和使用教程
- Oracle11g链接提示未“在本地计算机注册“OraOLEDB.Oracle”解决方法
- 自定义控件--CircleImageView(类似于QQ、微信圆形头像自定义控件)
- StoryBoard国际化
- lua日志文件处理代码
- Android Touch事件分发机制
- 最全的Swift社交应用文本输入优化汇总
- Nagios 安装及微信短信提醒
- POJ 1154 Letter game (DFS)
- 深入理解HTML5:语义、标准与样式
- Palindrome Partitioning与动态规划
- C++实现24点游戏算法
- Android WebView常见问题及解决方案汇总