ubuntu设置时区为美国中部时间西六区
查看当前ubuntu系统时区
date -R Fri, 23 Dec 2016 21:42:38 +0800
显示的是东八区时间及北京时间
然后输入tzselect 按照提示修改对应时区 本例子修改为美国中部时间 西六区
~$ 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) Arctic Ocean 5) Asia 6) Atlantic Ocean 7) Australia 8) Europe 9) Indian Ocean 10) Pacific Ocean 11) coord - I want to use geographical coordinates. 12) TZ - I want to specify the time zone using the Posix TZ format. #? 2 Please select a country whose clocks agree with yours. 1) Anguilla 28) Haiti 2) Antigua & Barbuda 29) Honduras 3) Argentina 30) Jamaica 4) Aruba 31) Martinique 5) Bahamas 32) Mexico 6) Barbados 33) Montserrat 7) Belize 34) Nicaragua 8) Bolivia 35) Panama 9) Brazil 36) Paraguay 10) Canada 37) Peru 11) Caribbean Netherlands 38) Puerto Rico 12) Cayman Islands 39) St Barthelemy 13) Chile 40) St Kitts & Nevis 14) Colombia 41) St Lucia 15) Costa Rica 42) St Maarten (Dutch part) 16) Cuba 43) St Martin (French part) 17) Curacao 44) St Pierre & Miquelon 18) Dominica 45) St Vincent 19) Dominican Republic 46) Suriname 20) Ecuador 47) Trinidad & Tobago 21) El Salvador 48) Turks & Caicos Is 22) French Guiana 49) United States 23) Greenland 50) Uruguay 24) Grenada 51) Venezuela 25) Guadeloupe 52) Virgin Islands (UK) 26) Guatemala 53) Virgin Islands (US) 27) Guyana #? 10 Please select one of the following time zone regions. 1) Newfoundland Time, including SE Labrador 2) Atlantic Time - Nova Scotia (peninsula), PEI 3) Atlantic Time - Nova Scotia (Cape Breton) 4) Atlantic Time - New Brunswick 5) Atlantic Time - Labrador - most locations 6) Atlantic Standard Time - Quebec - Lower North Shore 7) Eastern Time - Ontario & Quebec - most locations 8) Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973 9) Eastern Time - Thunder Bay, Ontario 10) Eastern Time - east Nunavut - most locations 11) Eastern Time - Pangnirtung, Nunavut 12) Central Time - Resolute, Nunavut 13) Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut 14) Central Time - central Nunavut 15) Central Time - Manitoba & west Ontario 16) Central Time - Rainy River & Fort Frances, Ontario 17) Central Standard Time - Saskatchewan - most locations 18) Central Standard Time - Saskatchewan - midwest 19) Mountain Time - Alberta, east British Columbia & west Saskatchewan 20) Mountain Time - west Nunavut 21) Mountain Time - central Northwest Territories 22) Mountain Time - west Northwest Territories 23) Mountain Standard Time - Creston, British Columbia 24) Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia 25) Mountain Standard Time - Fort Nelson, British Columbia 26) Pacific Time - west British Columbia 27) Pacific Time - south Yukon 28) Pacific Time - north Yukon #? 17 The following information has been given: Canada Central Standard Time - Saskatchewan - most locations Therefore TZ='America/Regina' will be used. Local time is now: Fri Dec 23 07:43:05 CST 2016. Universal Time is now: Fri Dec 23 13:43:05 UTC 2016. Is the above information OK? 1) Yes 2) No #? 1 You can make this change permanent for yourself by appending the line TZ='America/Regina'; 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: America/Regina mag-sit@mag-sit:~$ sudo cp /usr/share/zoneinfo/America/Regina /etc/localtime [sudo] password for mag-sit: mag-sit@mag-sit:~$ date Fri Dec 23 07:44:57 CST 2016 mag-sit@mag-sit:~$ date -R Fri, 23 Dec 2016 07:45:02 -0600
作者:熊哥club
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明。文章部分内容来源网络,如有版权问题,请留言告知,博主会尽快删除.
微信扫描下方二维码关注【熊哥club】,回复1024获取程序员必备IT电子书,回复java获取全套学习资源


分类:
linux
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?