Ubuntu使用tzselect修改时区
1、命令行运行
sudo tzselect
2、选择洲区(这里选择亚洲Asia)
waichung@desktop:~$ sudo tzselect
[sudo] password for waichung:
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、选择国家(这里选择中国China)
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.
) Beijing Time
) Xinjiang Time
#?
5、选Yes
The following information has been given:
China
Beijing Time
Therefore TZ='Asia/Shanghai' will be used.
Local time is now: Thu May :: CST .
Universal Time is now: Thu May :: 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
方式1:在用户目录的.profile文件中加入一行下列内容,然后source ~/.profile使其生效
export TZ='Asia/Shanghai'
方式2:复制相应的时区文件到/etc目录下
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
6、同步时间
waichung@desktop:~$ sudo ntpdate pool.ntp.org
May :: ntpdate[]: adjust time server 193.228.143.14 offset -0.154279 sec
Ubuntu使用tzselect修改时区的更多相关文章
- ubuntu下如何修改时区和时间
1.修改时区 sudo tzselect (按提示选择即可) sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 2. 修改时间 sudo ...
- Ubuntu 14.04 修改时区
执行下面命令,并按照提示选择"Asia/Shanghai": sudo dpkg-reconfigure tzdata 正常执行结果为: Current default time ...
- Linux服务器修改时区时间
时间的一致性很关键,对于日志的分析和程序的对接都至关重要! 01.tzselect 修改时区 可以使用命令 tzselect,修改时区.操作示例: $ tzselect Please identify ...
- ubuntu server修改时区
公司用的是ubuntu server 服务器在美国亚马逊VPS 现在要修改时区 执行:tzselect 或直接修改 /etc/timezone 文件,我是改成(America/Los_Angeles) ...
- Linux —— 时间(tzselect、timedatactl命令,查看和修改时区,修改时区为东八区)【转】
转自:https://blog.csdn.net/weixin_42167759/article/details/90648225 一.设置linux修改时区首先查看当前时区 #date -R显示结果 ...
- Ubuntu修改时区和更新时间
先查看当前系统时间 root@ubuntu:/# date -R 结果时区是:-0500 我需要的是东八区,这儿显示不是,所以需要设置一个时区 1.运行tzselect root@ubuntu:/# ...
- ubuntu下修改时区
使用一个虚拟机服务,其时区设置的为格林兰标准时区,我北京时区在东八区,较其快八个小时. 修改时区需要执行 tzselect 一步步选择下来,注意确认后的information Therefore TZ ...
- ubuntu修改时区和时间的方法
改时区参考 http://blog.sina.com.cn/s/blog_6c9d65a1010145st.html 1.首先查看时区: swfsadmin@swfsubuntu:~$ date -R ...
- Ubuntu修改时区和时间
1.查看当前时区 date -R 返回显示是 +0000 2.修改时区 tzselect 然后提示选择时区,按顺序选4.9.1,然后确认选1 3.更新本地时区 sudo cp /usr/share/z ...
随机推荐
- node 中的定时器, nextTick()和setImmediate()的使用
1.node中使用定时器的问题在于,它并非精确的.譬如setTimeout()设定一个任务在10ms后执行,但是在9ms后,有一个任务占用了5ms,再次轮到定时器时,已经耽误了4ms. 好了node中 ...
- 【UVa】1606 Amphiphilic Carbon Molecules(计算几何)
题目 题目 分析 跟着lrj学的,理解了,然而不是很熟,还是发上来供以后复习 代码 #include <bits/stdc++.h> using namespace std; ; stru ...
- Oracle数据库学习笔记(一)
Oracle的体系结构大体上分为两部分:Instance(实例)和Database(数据库). Instance(实例) :在Oracle Instance中主要包含了SGA以及一些进程(例如:P ...
- python cx_Oracle模块的安装和使用
$wget http://download.oracle.com/otn/linux/instantclient/10204/basic-10.2.0.4.0-linux-x86_64.zip 3 ...
- Array 数组类
除了 Object 之外, Array 类型恐怕是 ECMAScript 中最常用的类型了.而且,ECMAScript 中的数组与其他多数语言中的数组有着相当大的区别.虽然 ECMAScript 数组 ...
- C++模板类练习题
题目说明: 编写一个程序,使用类模板对数组元素进行排序,倒置.查找和求和 具有对数组元素进行排序,倒置.查找和求和功能, 然后产生类型实参分别为int型和double型的两个模板类, 分别对整型数组与 ...
- NIO buffer 缓冲区 API
package bhz.nio.test; import java.nio.IntBuffer; public class TestBuffer { public static void main(S ...
- PHP程序连接多个redis实例做缓存
1.redis配置: $CONFIG_REDIS = array( array('host' => '192.168.19.29', 'port' => '6379', 'dbIn ...
- Python小知识点(3)--装饰器
(1)装饰器含参数,被装饰函数不含(含)参数 实例代码如下: import time # 装饰器函数 def wrapper(func): def done(*args,**kwargs): star ...
- 【读书笔记】 DevOps实践 - 驭DevOps之力强化技术栈并优化IT运行
读书小结 DevOps实践 - 驭DevOps之力强化技术栈并优化IT运行 这本书共200页,读完大概三天:(我指的不是fulltime的一天,而是工作时间以外的一天) 本书是参加16年QConf开发 ...