• 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) Africa
     2) Americas
     3) Antarctica
     4) Asia
     5) Atlantic Ocean
     6) Australia
     7) Europe
     8) Indian Ocean
     9) 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) Russia
     2) Antarctica		     16) Georgia		  30) Laos		       44) Saudi Arabia
     3) Armenia		     17) Hong Kong		  31) Lebanon		       45) Seychelles
     4) Azerbaijan		     18) India			  32) Macau		       46) Singapore
     5) Bahrain		     19) Indonesia		  33) Malaysia		       47) Sri Lanka
     6) Bangladesh		     20) Iran			  34) Mongolia		       48) Syria
     7) Bhutan		     21) Iraq			  35) Myanmar (Burma)	       49) Taiwan
     8) Brunei		     22) Israel			  36) Nepal		       50) Tajikistan
     9) 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
    #? 1
    
    The following information has been given:
    
    	China
    	Beijing Time
    
    Therefore 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
    #? 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
    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:/# 
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
  • 相关阅读:
    飞书即时消息无需API开发连接Cohere,打造飞书AI智能问答助手
    数字ic设计|ASIC芯片开发过程
    SpringMVC的上传下载
    计算机网络原原理学习资料分享---第一章/第一节(为有梦想的自己加油!)
    Hudi 系列-基础概念-索引机制
    Eureka
    四、synchronized、volatile 、Lock
    [Qualcomm][Voice]语音通话软件框架介绍(翻译)
    Python学习笔记之分支结构与循环结构
    RabbitMQ小结
  • 原文地址:https://blog.csdn.net/mankeywang/article/details/133769331