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

Ubuntu更改时区

sudo apt install tzdata
进行安装时区,有很多时区可供选择。

然后执行:tzselect

root@d75c94dcd226:/# date
20231011日 星期三 06:25:12 UTC
root@d75c94dcd226:/# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, "coord", or "TZ".1) Africa2) Americas3) Antarctica4) Asia5) Atlantic Ocean6) Australia7) Europe8) Indian Ocean9) Pacific Ocean
10) coord - I want to use geographical coordinates.
11) TZ - I want to specify the timezone using the Posix TZ format.
#? 4
Please select a country whose clocks agree with yours.1) Afghanistan		     15) French S. Terr.	  29) Kyrgyzstan	       43) Russia2) Antarctica		     16) Georgia		  30) Laos		       44) Saudi Arabia3) Armenia		     17) Hong Kong		  31) Lebanon		       45) Seychelles4) Azerbaijan		     18) India			  32) Macau		       46) Singapore5) Bahrain		     19) Indonesia		  33) Malaysia		       47) Sri Lanka6) Bangladesh		     20) Iran			  34) Mongolia		       48) Syria7) Bhutan		     21) Iraq			  35) Myanmar (Burma)	       49) Taiwan8) Brunei		     22) Israel			  36) Nepal		       50) Tajikistan9) Cambodia		     23) Japan			  37) Oman		       51) Thailand
10) China		     24) Jordan			  38) Pakistan		       52) Turkmenistan
11) Christmas Island	     25) Kazakhstan		  39) Palestine		       53) United Arab Emirates
12) Cocos (Keeling) Islands  26) Korea (North)		  40) Philippines	       54) Uzbekistan
13) Cyprus		     27) Korea (South)		  41) Qatar		       55) Vietnam
14) East Timor		     28) Kuwait			  42) Réunion		       56) Yemen
#? 10
Please select one of the following timezones.
1) Beijing Time
2) Xinjiang Time, Vostok
#? 1The following information has been given:ChinaBeijing TimeTherefore TZ='Asia/Shanghai' will be used.
Selected time is now:	Wed Oct 11 14:26:05 CST 2023.
Universal Time is now:	Wed Oct 11 06:26:05 UTC 2023.
Is the above information OK?
1) Yes
2) No
#? 1You can make this change permanent for yourself by appending the lineTZ='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
root@d75c94dcd226:/# date
20231011日 星期三 06:26:13 UTC
root@d75c94dcd226:/# cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime 
root@d75c94dcd226:/# date
20231011日 星期三 14:29:03 CST
root@d75c94dcd226:/# 
http://www.lryc.cn/news/189452.html

相关文章:

  • 0144 文件管理
  • python psutil库之——获取网络信息(网络接口信息、网络配置信息、以太网接口、ip信息、ip地址信息)
  • uniapp上echarts地图钻取
  • scratch保护环境 2023年5月中国电子学会图形化编程 少儿编程 scratch编程等级考试一级真题和答案解析
  • RPC分布式网络通信框架项目
  • Navicat如何连接远程服务器的MySQL
  • 【计算机网络笔记】计算机网络的结构
  • 排序算法-插入排序法(InsertSort)
  • RuntimeError: “slow_conv2d_cpu“ not implemented for ‘Half‘
  • 前端 | 前端工程化
  • 学信息系统项目管理师第4版系列24_整合管理
  • 轻量级虚拟化技术草稿
  • bootz启动 Linux内核过程中涉及的 do_bootm_states 函数
  • springcloud学习笔记(3)-服务管理组件Nacos
  • Insight h2database 更新、读写锁以及事务原理
  • skywalking动态配置[集成nacos/apollo/consul]
  • UniApp创建项目HelloWorld
  • Qt/C++原创推流工具/支持多种流媒体服务/ZLMediaKit/srs/mediamtx等
  • 学习黑马程序员JavaScript总结
  • 浅谈高速公路服务区分布式光伏并网发电
  • MATLAB算法实战应用案例精讲-【图像处理】机器视觉(番外篇)
  • 塑胶材料检测对激光焊机的作用
  • 将Eureka服务注册到Eureka中心
  • 将网站域名访问从http升级到https(腾讯云/阿里云)
  • QT通过TCP协议发送结构体数据
  • C++标准库之numeric
  • 第六章:最新版零基础学习 PYTHON 教程—Python 正则表达式(第二节 - Python 中的正则表达式与示例套装)
  • 【Python】WebUI自动化—Selenium的下载和安装、基本用法、项目实战(16)
  • c++视觉处理---图像重映射
  • 基于YOLO算法的单目相机2D测量(工件尺寸和物体尺寸)