改时区参考

http://blog.sina.com.cn/s/blog_6c9d65a1010145st.html

1.首先查看时区:

swfsadmin@swfsubuntu:~$ date -R
Tue, Dec :: +

如果要修改时区,执行sudo tzselect

2.选择区域:亚洲

swfsadmin@swfsubuntu:~$ sudo tzselect
[sudo] password for swfsadmin:
Sorry, try again.
[sudo] password for swfsadmin:
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
) Africa
) Americas
) Antarctica
) Arctic Ocean
) Asia
) Atlantic Ocean
) Australia
) Europe
) Indian Ocean
) Pacific Ocean
) none - I want to specify the time zone using the Posix TZ format.
#?

3.选择国家:中国

Please select a country.
) Afghanistan ) Israel ) Palestine
) Armenia ) Japan ) Philippines
) Azerbaijan ) Jordan ) Qatar
) Bahrain ) Kazakhstan ) Russia
) Bangladesh ) Korea (North) ) Saudi Arabia
) Bhutan ) Korea (South) ) Singapore
) Brunei ) Kuwait ) Sri Lanka
) Cambodia ) Kyrgyzstan ) Syria
) China ) Laos ) Taiwan
) Cyprus ) Lebanon ) Tajikistan
) East Timor ) Macau ) Thailand
) Georgia ) Malaysia ) Turkmenistan
) Hong Kong ) Mongolia ) United Arab Emirates
) India ) Myanmar (Burma) ) Uzbekistan
) Indonesia ) Nepal ) Vietnam
) Iran ) Oman ) Yemen
) Iraq ) Pakistan
#?

4.选择时区:北京时间

Please select one of the following time zone regions.
) east China - Beijing, Guangdong, Shanghai, etc.
) Heilongjiang (except Mohe), Jilin
) central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.
) most of Tibet & Xinjiang
) west Tibet & Xinjiang
#?

5.确认验证:

The following information has been given:

        China
east China - Beijing, Guangdong, Shanghai, etc. Therefore TZ='Asia/Shanghai' will be used.
Local time is now: Tue Dec :: CST .
Universal Time is now: Tue Dec :: UTC .
Is the above information OK?
) Yes
) No
#? 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
6.复制文件到/etc目录下
sudo cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime
7.更新时间
sudo ntpdate time.windows.com

改时间参考:

http://5154091.blog.hexun.com/30735220_d.html

修改时间

sudo date -s MM/DD/YY //修改日期
sudo date -s hh:mm:ss //修改时间

在修改时间以后,修改硬件CMOS的时间

sudo hwclock --systohc //非常重要,如果没有这一步的话,后面时间还是不准

http://www.cnblogs.com/php5/archive/2011/02/15/1955432.html

http://os.51cto.com/art/200908/142234.htm

ubuntu修改时区和时间的方法的更多相关文章

  1. Ubuntu修改时区和时间

    1.查看当前时区 date -R 返回显示是 +0000 2.修改时区 tzselect 然后提示选择时区,按顺序选4.9.1,然后确认选1 3.更新本地时区 sudo cp /usr/share/z ...

  2. Ubuntu 修改时区和时间

    tzselect #根据提示选择时区 sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #把设置好的时区文件粘贴到 /etc/local ...

  3. 修改linux系统时间的方法(date命令)

    修改linux系统时间的方法(date命令) 来源:互联网 作者:佚名 时间:11-18 23:22:27 [大 中 小] date命令不仅可以显示系统当前时间,还可以用它来修改系统时间,下面简单的介 ...

  4. Ubuntu修改时区和更新时间

    先查看当前系统时间 root@ubuntu:/# date -R 结果时区是:-0500 我需要的是东八区,这儿显示不是,所以需要设置一个时区 1.运行tzselect root@ubuntu:/# ...

  5. ubuntu下如何修改时区和时间

    1.修改时区 sudo tzselect (按提示选择即可) sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 2. 修改时间 sudo ...

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

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

  7. mysql修改时区的几种方法(转载自https://www.cnblogs.com/shiqiangqiang/p/8393662.html)

    说明: 以下记录修改mysql时区的几种方法. 具体: 方法一:通过mysql命令行模式下动态修改 1.1 查看mysql当前时间,当前时区 select curtime(); #或select no ...

  8. ubuntu系统调整时区和时间

    date: 2019-05-30  10:14:23 author:headsen  chen 个人原创博客,转录需要注明作者和出处. 1,安装ntpdate,同步标准时间 root@hk-confl ...

  9. mysql修改时区的几种方法

    说明: 以下记录修改mysql时区的几种方法. 具体:方法一:通过mysql命令行模式下动态修改1.1 查看mysql当前时间,当前时区 > select curtime(); #或select ...

随机推荐

  1. windows下nodejs服务器的安装与配置

    1下载安装 download from the link: https://nodejs.org/en/ windows下的安装直接运行exe,略过-- 注:由于用户权限的问题,最好将nodejs安装 ...

  2. 数组的splice方法

    splice 该方法向或者从数组中添加或者删除项目,返回被删除的项目,同时也会改变原数组. splice(index,howmany,item1,...itemX) index参数:必须,整数,规定添 ...

  3. java虚拟机规范(se8)——java虚拟机结构(五)

    2.10 异常 java虚拟机中的异常用Throwable类或者它的子类的实例来表示.抛出一个异常会导致立即非本地(an inmediate nolocal)的控制转移,从发生异常的地方跳到处理异常的 ...

  4. MySQL保存或更新 saveOrUpdate

    1. 引子 在项目开发过程中,有一些数据在写入时候,若已经存在,则覆盖即可.这样可以防止多次重复写入唯一键冲突报错.下面先给出两个MyBatis配置文件中使用saveOrUpdate的示例 <! ...

  5. nginx开启gzip压缩前端css,js

    利用nginx实现前后端分离, nginx配置文件,nginx.conf配置采用gzip压缩: 在server中添加: gzip on; #开启gzip gzip_min_length 1k; #低于 ...

  6. _findfirst和_findnext

    1.首先是_finddata结构体,用于存储文件信息的结构体. 2._findfirst函数:long _findfirst(const char *, struct _finddata_t *); ...

  7. P1270 【“访问”美术馆】

    $\large{\text{一千个Oier程序中有一千种树形DP}}$ 思路都差不多的,但是每个人都有自己的状态定义与转移 不妨定义$dp[i][j]$表示,在$i$子树内,偷$j$张画,且不考虑根到 ...

  8. c run-time library 和 standard c++ library

    参考: c run-time libraries:  http://msdn.microsoft.com/zh-cn/library/vstudio/abx4dbyh(v=vs.100).aspx H ...

  9. 2、Centos6 安装tomcat8.5.31

    1.下载 安装包 wget http://mirrors.aliyun.com/apache/tomcat/tomcat-8/v8.5.31/bin/apache-tomcat-8.5.31.tar. ...

  10. 《Redis设计与实现》学习笔记

    第2章 简单动态字符串(SDS) redis的字符串不是直接用c语言的字符串,而是用了一种称为简单动态字符串(SDS)的抽象类型,并将其作为默认字符串. redis中包含字符串值的键值对在底层都是由S ...