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

最新文章

  1. 著名的sql注入问题-问题的原因分析及总结
  2. CLR via C# 3rd - 01 - The CLR's Execution Model
  3. sublime text3 less2css rem
  4. 一个解决表单中的文字和文本区域(textarea)上对齐的方法
  5. PhpStorm下Laravel代码智能提示
  6. HDOJ/HDU 1200 To and Fro(加密解密字符串)
  7. 【C++探索之旅】开宗明义+第一部分第一课:什么是C++?
  8. Vim中设置括号自动补全
  9. Numpy 学习(一)
  10. 【软件工程】5.8 黑盒&白盒测试
  11. GO调度模型的缺点
  12. Redis实战 内存淘汰机制
  13. 全网最详细的Sublime Text 3的设置字体及字体大小(图文详解)
  14. 二分图最大权匹配模板(pascal)
  15. spring cloud学习(七)Spring Cloud Config(续)
  16. .NET 4.5 Task异步编程学习资料
  17. 读书笔记--C陷阱与缺陷(七)
  18. java基础---->java中Properties的使用
  19. bugku数字验证绕过正则
  20. ModelForm组件

热门文章

  1. Oracle 10 Recycle Bin回收站
  2. 主从DNS服务器的搭建
  3. Protobuf3教程
  4. 浅谈Java引用和Threadlocal的那些事
  5. 十年Java架构师分享
  6. Android SQLite最简单demo实现(增删查改)
  7. C#获取外网IP、本机MAC地址及Ping的实现
  8. leetcode706
  9. 2.redis配置
  10. python:ord()和chr()——字符串和ASCll编码转换