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

[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. Thymleaf中th:each标签遍历list如何获取index

    简单介绍:传递给后台一个String类型的list,需要获取到list的每一个元素,然后进行筛选,得到正确的文本值,看代码就明白了 代码: //后台java代码//failList是一个String类 ...

  2. appJSON["window"]["navigationBarTextStyle"] 字段需为 black 或 white

    appJSON["window"]["navigationBarTextStyle"] 字段需为 black 或 white     改动成这个就可以了 &qu ...

  3. Ethereum(1)—— 基本介绍

    1 环境安装 安装Ethereum 协议的Go语言的最新实现. git clone https://github.com/ethereum/go-ethereum.git make all cd bu ...

  4. python下载大文件

    1. wget def download_big_file_with_wget(url, target_file_name): """ 使用wget下载大文件 Note: ...

  5. Codeforces 1097E. Egor and an RPG game 构造

    原文链接https://www.cnblogs.com/zhouzhendong/p/CF1097E.html 题解 首先我们求出 $k = f(n) = \max\{x|\frac{x(x+1)}2 ...

  6. 项目之初的模型设计与status状态字段

    0X01 开始做一个app的时候,要先做的是流程设计与数据库模型设计. 但做的模型设计往往是设置字段满足当前的需求,缺乏足够的经验,即使为以后的功能预留出位置,也无法考虑周全. 比如,刚开始做用户表, ...

  7. Hibernate 映射一对一关联关系

    基于外键的方式: 附上代码: public class Manager { private Integer mgrId; private String mgrName; private Departm ...

  8. React(三)JSX内置表达式

    (一)JSX是什么? React 使用 JSX 来替代常规的 JavaScript. JSX 是一个看起来很像 XML 的 JavaScript 语法扩展. 我们不需要一定使用 JSX,但它有以下优点 ...

  9. Java之为何配置环境变量

    一.不要问一个程序员为什么命名是基础零(^_^) 二.Java为什么跨平台: 因为有java虚拟机,一个程序的运行必然要依赖于系统,java的跨平台是因为java虚拟机jvm把不同平台编写的代码编译成 ...

  10. CSS3_盒阴影_倒影_盒子大小可调

    1. 盒阴影 会产生一个或者多个阴影 使用:    (多个阴影,以逗号隔开) /* (不能为负值) (可以负值) */ /* 水平方向偏移量 垂直反向偏移量 模糊程度 扩散程度 颜色 是否是内阴影; ...