查看当前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