当前位置: 首页 > news >正文

Ubantu 更新时间方法

1.首先查看时区:

swfsadmin@swfsubuntu:~$ date -R
Tue, 17 Dec 2013 18:23:01 +0800

如果要修改时区,执行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.
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

3.选择国家:中国

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

4.选择时区:北京时间

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

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 17 18:22:10 CST 2013.
Universal Time is now: Tue Dec 17 10:22:10 UTC 2013.
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

6.复制文件到/etc目录下

sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

转载于:https://www.cnblogs.com/dywangzq/p/9092049.html

相关文章:

  • [xdoj] 13011302 数字计数 数字计数的复仇
  • php面试题12(多态web服务器共享session的方法:将session存到数据库)($val=$data[$key];)...
  • nohup和后台运行,进程查看及终止
  • bash命令行初探
  • 转: 关于linux用户时间与系统时间的说明
  • # 学号 2017-2018-20172309 《程序设计与数据结构》实验三报告
  • day01.1 vmware虚拟机
  • VMware Vsphere 虚拟化
  • CentOS7切换到root用户和退回普通用户
  • BZOJ5289 洛谷4437:[HNOI/AHOI2018]排列——题解
  • mysql grant授权
  • classloader实战:一个程序使用相同数据库的两个不同版本的jar包
  • 卷积核与特征提取
  • 常用的几个vagrant命令
  • SQL优化笔记
  • IE9 : DOM Exception: INVALID_CHARACTER_ERR (5)
  • 【140天】尚学堂高淇Java300集视频精华笔记(86-87)
  • DataBase in Android
  • java 多线程基础, 我觉得还是有必要看看的
  • Java程序员幽默爆笑锦集
  • js递归,无限分级树形折叠菜单
  • mysql 5.6 原生Online DDL解析
  • nfs客户端进程变D,延伸linux的lock
  • Node项目之评分系统(二)- 数据库设计
  • Python_OOP
  • 对话 CTO〡听神策数据 CTO 曹犟描绘数据分析行业的无限可能
  • 讲清楚之javascript作用域
  • 离散点最小(凸)包围边界查找
  • 那些被忽略的 JavaScript 数组方法细节
  • 前端_面试
  • 前端技术周刊 2019-02-11 Serverless
  • 前端性能优化——回流与重绘
  • 王永庆:技术创新改变教育未来
  • 以太坊客户端Geth命令参数详解
  • 转载:[译] 内容加速黑科技趣谈
  • d²y/dx²; 偏导数问题 请问f1 f2是什么意思
  • 如何通过报表单元格右键控制报表跳转到不同链接地址 ...
  • 如何正确理解,内页权重高于首页?
  • ​插件化DPI在商用WIFI中的价值
  • #14vue3生成表单并跳转到外部地址的方式
  • #FPGA(基础知识)
  • #ifdef 的技巧用法
  • (1)常见O(n^2)排序算法解析
  • (2009.11版)《网络管理员考试 考前冲刺预测卷及考点解析》复习重点
  • (LNMP) How To Install Linux, nginx, MySQL, PHP
  • (第8天)保姆级 PL/SQL Developer 安装与配置
  • (五)关系数据库标准语言SQL
  • (转)jQuery 基础
  • (转)MVC3 类型“System.Web.Mvc.ModelClientValidationRule”同时存在
  • .NET 表达式计算:Expression Evaluator
  • .NET 命令行参数包含应用程序路径吗?
  • .net 使用ajax控件后如何调用前端脚本
  • .NET 同步与异步 之 原子操作和自旋锁(Interlocked、SpinLock)(九)
  • .Net各种迷惑命名解释
  • /bin/bash^M: bad interpreter: No such file ordirectory