ubuntu修改时区和时间的方法
改时区参考
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
改时间参考:
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修改时区和时间的方法的更多相关文章
- Ubuntu修改时区和时间
1.查看当前时区 date -R 返回显示是 +0000 2.修改时区 tzselect 然后提示选择时区,按顺序选4.9.1,然后确认选1 3.更新本地时区 sudo cp /usr/share/z ...
- Ubuntu 修改时区和时间
tzselect #根据提示选择时区 sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #把设置好的时区文件粘贴到 /etc/local ...
- 修改linux系统时间的方法(date命令)
修改linux系统时间的方法(date命令) 来源:互联网 作者:佚名 时间:11-18 23:22:27 [大 中 小] date命令不仅可以显示系统当前时间,还可以用它来修改系统时间,下面简单的介 ...
- Ubuntu修改时区和更新时间
先查看当前系统时间 root@ubuntu:/# date -R 结果时区是:-0500 我需要的是东八区,这儿显示不是,所以需要设置一个时区 1.运行tzselect root@ubuntu:/# ...
- ubuntu下如何修改时区和时间
1.修改时区 sudo tzselect (按提示选择即可) sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 2. 修改时间 sudo ...
- centos修改时区,设置时间
在我们使用CentOS系统的时候,也许时区经常会出现问题,有时候改完之后还是会出错,下面我们就来学习一种方法来改变这个状况.如果没有安装,而你使用的是 CentOS系统 那使用命令 yum insta ...
- mysql修改时区的几种方法(转载自https://www.cnblogs.com/shiqiangqiang/p/8393662.html)
说明: 以下记录修改mysql时区的几种方法. 具体: 方法一:通过mysql命令行模式下动态修改 1.1 查看mysql当前时间,当前时区 select curtime(); #或select no ...
- ubuntu系统调整时区和时间
date: 2019-05-30 10:14:23 author:headsen chen 个人原创博客,转录需要注明作者和出处. 1,安装ntpdate,同步标准时间 root@hk-confl ...
- mysql修改时区的几种方法
说明: 以下记录修改mysql时区的几种方法. 具体:方法一:通过mysql命令行模式下动态修改1.1 查看mysql当前时间,当前时区 > select curtime(); #或select ...
随机推荐
- CSS3 响应式布局: @media (min/max-width:***) @font-face
响应式布局 responsive design @media 属性 bootstrap css 分析: @media (min-width:768px){ body{***} } use @medi ...
- 小程序登录、微信网页授权(Java版)
首先呢,“登录”.“授权”.“授权登录”,是一样的意思,不用纠结. 写小程序授权登录的代码前,需要了解清楚openid与unionid的区别,这里再简单介绍一下: 腾讯有个 “微信·开放平台”,只有企 ...
- SpringBoot框架的权限管理系统
springBoot框架的权限管理系统,支持操作权限和数据权限,后端采用springBoot,MyBatis,Shiro,前端使用adminLTE,Vue.js,bootstrap-table.tre ...
- python 的print和特殊方法 __str__和__repr__
先提出一个疑问,为什么print函数可以直接打印参数呢?即使是数字?例如print 1,就会打印1.我们知道1的类型是整型(题外话,在python中1是常量,也是类int的对象,而java中1只是常量 ...
- VBScript操作SFTP
示例代码主要通过VBScript实现对SFTP的上传下载功能 ' Return yyyyMM base on current date Function FormatCurrentDate() Cur ...
- struts2 中 Preparable 接口实现数据准备
今天才知道struts还有Preparable接口,实现此接口需要实现其prepare()方法,调用action中其他方法之前会先调用prepare()方法.此接口和方法可以用于初始化一些数据. 测试 ...
- Linux ALSA声卡驱动之五:移动设备中的ALSA(ASoC)
转自http://blog.csdn.net/droidphone/article/details/7165482 1. ASoC的由来 ASoC--ALSA System on Chip ,是建立 ...
- springcloud常见问题处理
无法在任何已知服务器上执行请求. 原因是注册中心未启动.在使用springcloud搭建微服务时,一定要先启动注册中心,再启动服务端和客户端.具体报错如下: com.netflix.discovery ...
- /dev/null和/dev/zero的区别
/dev/null,外号叫无底洞,你可以向它输出任何数据,它通吃,并且不会撑着!/dev/zero,是一个输入设备,你可你用它来初始化文件. /dev/null------它是空设备,也称为位桶(bi ...
- 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. ...