首先查看时间发现和百度的时间不一样

[root@www ~]# date
Wed Dec 5 14:00:32 CST 2018

1、配置ntp服务器,设置时区同步,请参照ntp篇  https://www.cnblogs.com/effortsing/p/10011459.html

上面操作完后时间仍然无法同步,需要操作下面才可以

2、设置vmare虚拟机时区:

2.1 设置时区为上海

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 设置时区为上海

2.1  然后通过tzselect命令来修改时区

执行tzselect命令 --> 选择Asia --> 选择China --> 选择Beijing — 选择yes ,
执行完tzselect命令选择时区后,时区并没有更改,将export TZ=Asia/Shanghai   添加到/etc/profile文 件中去,然后退出并重新登陆即可。

sed -i '$a\export TZ=Asia/Shanghai' /etc/profile && source /etc/profile && date

下面是执行过程

[root@www ~]# tzselect
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
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
Please select one of the following time zone regions.
1) Beijing Time
2) Xinjiang Time
#? 1

The following information has been given:

China
Beijing Time

Therefore TZ='Asia/Shanghai' will be used.
Local time is now: Wed Dec 5 13:57:48 CST 2018.
Universal Time is now: Wed Dec 5 05:57:48 UTC 2018.
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

[root@www ~]# sed -i '$a\export TZ=Asia/Shanghai' /etc/profile

[root@www ~]# sed -i '$d' /etc/profile

查看时间已经正常

[root@www ~]# date
Wed Dec 5 14:11:49 CST 2018

https://blog.csdn.net/weixin_38323645/article/details/83046172

vmware虚拟机设置时区、时间的更多相关文章

  1. 给vmware虚拟机设置Ip,使用xshell远程连接Centos

    参考下面两位的分享才弄好,发表之前先对原作者表示感谢! 给Centos配置网络以及使用xshell远程连接Centos http://www.cnblogs.com/fuly550871915/p/4 ...

  2. VMWare虚拟机设置固定ip上网方法

    转自:http://blog.csdn.net/cyberrusher/article/details/7269795 1. 在VMWare工具栏中打开:编辑--->虚拟机网络编辑器, 打开VM ...

  3. Vmware虚拟机设置静态IP地址

    一.安装好虚拟后在菜单栏选择编辑→ 虚拟网络编辑器,打开虚拟网络编辑器对话框,选择Vmnet8 Net网络连接方式,随意设置子网IP,点击NAT设置页面,查看子网掩码和网关,后面修改静态IP会用到. ...

  4. VMWare 虚拟机设置网络访问

    使用桥接模式 将本机IP设置为和虚拟机IP在同一个可以上网的网段中

  5. vmware 虚拟机设置 redhat 桥接模式

    1.设置 vmware 网络模式 2.设置 linux 网络模式

  6. Vmware虚拟机设置主机端口映射

    转载自:https://blog.csdn.net/Mrqiang9001/article/details/80820321

  7. VMware虚拟机怎么从U盘启动

    VMware虚拟机怎么从U盘启动 发布时间:2016-01-12 18:50发布者:系统城-xtcjh浏览数:41951 VMware Workstation虚拟机可以安装各种操作系统,很多用户就想在 ...

  8. VMware中Linux系统时间与主机同步以及时区设置

    网络上有各种资料,但最简单的一种方法就是修改虚拟机的配置文件 *.vmx .修改 tools.syncTime = "FALSE" 为 tools.syncTime = " ...

  9. VMware 12安装虚拟机Mac OS X 10.10使用小技巧(虚拟机Mac OS X 10.10时间设置,虚拟机Mac OS X 10.10通过代理上网,Mac OS X 10.10虚拟机优化,VMware虚拟机相互复制)

    1:修改Mac OS 系统时间 2:Mac OS系统 通过代理上网 VMware 12安装Mac OS X 10.10虚拟机优化心得 虚拟显卡硬伤,所以必须要优化下才能用,优化的原则就是能精简的精简, ...

随机推荐

  1. 程序中的一些限制(基于Linux系统C语言)

    今天突然想起来几个问题,在程序运行起来时,存在一些限制: 1,数组的长度(成员的个数)存在限制!(数组定义的空间大小)2,一个进程里打开的文件数.3,一个文件的名字的长度.4,一个进程里创建线程的个数 ...

  2. 498. Diagonal Traverse

    题目思路 题目来源 C++实现 class Solution { public: vector<int> findDiagonalOrder(vector<vector<int ...

  3. JavaScript原型初学者指南

    视频Videohttps://www.youtube.com/watch... 前言 如果不好好的学习对象,你就无法在JavaScript中获得很大的成就.它们几乎是JavaScript编程语言的每个 ...

  4. electron-vue 升级 从2.x升级到4.x的坑

    子窗口 2.x modal为true let messageRightMenu = new BrowserWindow({ // height: 170, // width: 70, useConte ...

  5. Spring MVC 面试题

    什么是springMVC?作用? springMVC是一种web层mvc框架,用于替代servlet(处理|响应请求,获取表单参数,表单校验等). 为什么要用springMVC? 基本上,框架的作用就 ...

  6. CDOJ 图论专题 A.不是图论 强连通分量+拓扑排序 经典

    题目链接  在其中纠错第一次wa代码 #include <cstdio> #include <cstring> #include <cstdlib> #includ ...

  7. luogu P1362 兔子数 x

    P1362 兔子数 题目描述 设 S(N ) 表示 N 的各位数字之和,如 S(484) = 4+8+4 = 16, S(22) = 2+2 = 4.如果一个正整数满足 S(x*x) = S(x) * ...

  8. windows下kafka配置入门 示例

    实验平台与软件: 操作系统:windows7 32  位 java 开发包: jdk1.8.0_144 集群: zookeeper-3.3.6 消息队列: kafka_2.11-0.11.0.1 安装 ...

  9. JavaScript实现页面滚动到div区域div以动画方式出现

    用JavaScript实现页面滚动效果,以及用wow.js二种方式实现网页滚动效果 要实现效果是页面滚动到一块区域,该区域以动画方式出现. 这个效果需要二点: 一:我们要先写好一个css动画. 二:用 ...

  10. 前端学习之一_html学习

    html元素分类 内连元素:出现在行内的元素            <img>,<q>,<a> 块元素:前后自动插入换行的元素         <h1> ...