linux 时区设置

刺骨的言语ヽ痛彻心扉 2023-02-15 10:15 27阅读 0赞
  1. [root@lyn ~]# tzselect
  2. Please identify a location so that time zone rules can be set correctly.
  3. Please select a continent or ocean.
  4. 1) Africa
  5. 2) Americas
  6. 3) Antarctica
  7. 4) Arctic Ocean
  8. 5) Asia
  9. 6) Atlantic Ocean
  10. 7) Australia
  11. 8) Europe
  12. 9) Indian Ocean
  13. 10) Pacific Ocean
  14. 11) none - I want to specify the time zone using the Posix TZ format.
  15. #? 5
  16. Please select a country.
  17. 1) Afghanistan 18) Israel 35) Palestine
  18. 2) Armenia 19) Japan 36) Philippines
  19. 3) Azerbaijan 20) Jordan 37) Qatar
  20. 4) Bahrain 21) Kazakhstan 38) Russia
  21. 5) Bangladesh 22) Korea (North) 39) Saudi Arabia
  22. 6) Bhutan 23) Korea (South) 40) Singapore
  23. 7) Brunei 24) Kuwait 41) Sri Lanka
  24. 8) Cambodia 25) Kyrgyzstan 42) Syria
  25. 9) China 26) Laos 43) Taiwan
  26. 10) Cyprus 27) Lebanon 44) Tajikistan
  27. 11) East Timor 28) Macau 45) Thailand
  28. 12) Georgia 29) Malaysia 46) Turkmenistan
  29. 13) Hong Kong 30) Mongolia 47) United Arab Emirates
  30. 14) India 31) Myanmar (Burma) 48) Uzbekistan
  31. 15) Indonesia 32) Nepal 49) Vietnam
  32. 16) Iran 33) Oman 50) Yemen
  33. 17) Iraq 34) Pakistan
  34. #? 9
  35. Please select one of the following time zone regions.
  36. 1) east China - Beijing, Guangdong, Shanghai, etc.
  37. 2) Heilongjiang (except Mohe), Jilin
  38. 3) central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.
  39. 4) most of Tibet & Xinjiang
  40. 5) west Tibet & Xinjiang
  41. #? 1
  42. The following information has been given:
  43. China
  44. east China - Beijing, Guangdong, Shanghai, etc.
  45. Therefore TZ='Asia/Shanghai' will be used.
  46. Local time is now: Wed Nov 14 11:52:47 CST 2018.
  47. Universal Time is now: Wed Nov 14 03:52:47 UTC 2018.
  48. Is the above information OK?
  49. 1) Yes
  50. 2) No
  51. #? 1
  52. You can make this change permanent for yourself by appending the line
  53. TZ='Asia/Shanghai'; export TZ
  54. to the file '.profile' in your home directory; then log out and log in again.
  55. Here is that TZ value again, this time on standard output so that you
  56. can use the /usr/bin/tzselect command in shell scripts:
  57. Asia/Shanghai
  58. 注:修改profile文件,添加以下两行:
  59. TZ='Asia/Shanghai'
  60. export TZ
  61. [root@lyn ~]# vim /etc/profile
  62. [root@lyn ~]# source /etc/profile
  63. [root@lyn ~]# date
  64. Wed Nov 14 11:56:16 CST 2018
  65. 由此发现,时区由AST 变成了CSTCST :中国标准时间

发表评论

表情:
评论列表 (有 0 条评论,27人围观)

还没有评论,来说两句吧...

相关阅读

    相关 设置Linux系统的时区

    最近在写Dockerfile制作docker镜像的时候,发现生成的容器里面的系统时间不对。这才注意到还需要设置下系统时区。 设置linux系统时区的方法很简单(可以通过:da