查看服务器时间及所在时区

[root@localhost ~]# date -R
Fri, 07 Dec 2018 04:38:28 -0500

修改时区

先使用 tzselect 根据提示选择所在地区,最终生成时区

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.

然后编辑 /etc/profile 文件,添加 TZ='Asia/Shanghai'; export TZ,编辑完成后保存,运行 source /etc/profile

再次使用 date -R 查看时间

Fri, 07 Dec 2018 17:42:28 +0800

同步时间

安装 ntpdate

[root@localhost ~]# yum install ntpdate -y

前往 http://www.ntp.org.cn 查询可用的NTP服务,同步时间

[root@localhost ~]# ntpdate cn.ntp.org.cn

如同步出现错误 no server suitable for synchronization found,可尝试使用

[root@localhost ~]# ntpdate -u cn.ntp.org.cn

或者将域名改为ip

centos修改时区并同步时间的更多相关文章

  1. centos修改时区,同步时间

    查看当前系统时区 ls -la /etc/localtime 查看支持的时区 timedatectl list-timezones # 查看所有时区 timedatectl list-timezone ...

  2. Linux修改时区以及同步时间

    Centos7为例:修改时区 timedatectl list-timezones |grep Shanghai #查找中国时区的完整名称 Asia/Shanghai timedatectl set- ...

  3. centos7 修改时区,同步时间,Mysql修改时区

    查看时区 timedatectl status [root@localhost nova-back]# timedatectl status Local time: Thu 2019-05-23 15 ...

  4. centos 修改时区以及修正时间

    1.查看系统当前的时区 [app@127-0-0-1 shine]$ timedatectl Local time: Wed 2019-10-23 17:56:17 CST Universal tim ...

  5. 怎么让CentOS集群自动同步时间

    怎么让CentOS集群自动同步时间?首先机器要连外网,这样才能从互联网上同步时间,这是首先要了解的.好了,主要的方法如下: 在除了运行ntpd之外的机器上,执行: [html] # chkconfig ...

  6. CentOS集群自动同步时间的一种方法

    CentOS集群自动同步时间的一种方法 之前有篇日志是手动同步时间的 http://www.ahlinux.com/os/201304/202456.html 之所以这么干,是因为我们实验室的局域网只 ...

  7. Debian CentOS修改时区

    Debian修改时区: dpkg-reconfigure tzdata https://wiki.debian.org/TimeZoneChanges CentOS修改时区: timedatectl ...

  8. 修改centos服务器时区并同步最新时间

    rm -rf /etc/localtime ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ntpdate cn.pool.ntp.org ...

  9. centos修改时区,设置时间

    在我们使用CentOS系统的时候,也许时区经常会出现问题,有时候改完之后还是会出错,下面我们就来学习一种方法来改变这个状况.如果没有安装,而你使用的是 CentOS系统 那使用命令 yum insta ...

随机推荐

  1. 一次ES故障排查过程

    作者:莫那鲁道 原文:http://thinkinjava.cn/#blog 某天晚上,某环境 ES 出现阻塞, 运行缓慢.于是开始排查问题的过程. 开始 思路:现象是阻塞,通常是 CPU 彪高,导致 ...

  2. ABP给WebApi添加SwaggerUI,生成可交互接口文档

    在ABP模板项目中,通过SwaggerUI可以为我们的WebApi生成动态的可交互接口文档页面,从而可以很方便的测试调用我们的WebApi接口. 一.集成Swagger 右键项目YoYo.Web,打开 ...

  3. UOJ#110. 【APIO2015】Bali Sculptures 贪心 动态规划

    原文链接https://www.cnblogs.com/zhouzhendong/p/UOJ110.html 题解 我们发现n=2000 的子任务保证A=1! 分两种情况讨论: $n\leq 100$ ...

  4. selenium webdriver 如何添加cookie

    一. webdriver中常用的cookie方法 webdriver中提供了操作cookie的相关方法: get_cookies()                  获得cookie信息 add_c ...

  5. Java笔记(二十) 注解

    注解 一.内置注解 Java内置了一些常用注解: 1.@Override 该注解修饰一个方法,表示当前类重写了父类的该方法. 2.@Deprecated  该注解可以修饰类.方法.字段.参数等.表示对 ...

  6. jmeter(二十一)jmeter常用插件介绍

    jmeter作为一个开源的接口性能测试工具,其本身的小巧和灵活性给了测试人员很大的帮助,但其本身作为一个开源工具,相比于一些商业工具(比如LoadRunner),在功能的全面性上就稍显不足. 这篇博客 ...

  7. shell grep

    grep "str" file > /dev/null if [ $? -eq 1]; then echo "no str" else echo &quo ...

  8. python 生成器generator

    关于生成器,主要有以下几个 关键点的内容 一.什么是generator ,为什么要有generator? 二.两种创建生成器方式 三.yield关键字 四.generator 两个调用方法 next( ...

  9. oracle中的listener.ora和tnsnames.ora

    一.oracle的客户端与服务器端 oracle在安装完成后服务器和客户端都需要进行网络配置才能实现网络连接.    服务器端配置监听器,客户端配置网络服务名. 服务器端可配置一个或多个监听程序 . ...

  10. HttpClient参观记:.net core 2.2 对HttpClient到底做了什么?

    .net core 于 10月17日发布了 ASP.NET Core 2.2.0 -preview3,在这个版本中,我看到了一个很让我惊喜的新特性:HTTP Client Performance Im ...