ubuntu设置时区为美国中部时间西六区

时间:2024-12-27 13:34:50

查看当前ubuntu系统时区

date -R

Fri,  Dec  :: +

显示的是东八区时间及北京时间

然后输入tzselect 按照提示修改对应时区 本例子修改为美国中部时间 西六区

~$ tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, "coord", or "TZ".
) Africa
) Americas
) Antarctica
) Arctic Ocean
) Asia
) Atlantic Ocean
) Australia
) Europe
) Indian Ocean
) Pacific Ocean
) coord - I want to use geographical coordinates.
) TZ - I want to specify the time zone using the Posix TZ format.
#?
Please select a country whose clocks agree with yours.
) Anguilla ) Haiti
) Antigua & Barbuda ) Honduras
) Argentina ) Jamaica
) Aruba ) Martinique
) Bahamas ) Mexico
) Barbados ) Montserrat
) Belize ) Nicaragua
) Bolivia ) Panama
) Brazil ) Paraguay
) Canada ) Peru
) Caribbean Netherlands ) Puerto Rico
) Cayman Islands ) St Barthelemy
) Chile ) St Kitts & Nevis
) Colombia ) St Lucia
) Costa Rica ) St Maarten (Dutch part)
) Cuba ) St Martin (French part)
) Curacao ) St Pierre & Miquelon
) Dominica ) St Vincent
) Dominican Republic ) Suriname
) Ecuador ) Trinidad & Tobago
) El Salvador ) Turks & Caicos Is
) French Guiana ) United States
) Greenland ) Uruguay
) Grenada ) Venezuela
) Guadeloupe ) Virgin Islands (UK)
) Guatemala ) Virgin Islands (US)
) Guyana
#?
Please select one of the following time zone regions.
) Newfoundland Time, including SE Labrador
) Atlantic Time - Nova Scotia (peninsula), PEI
) Atlantic Time - Nova Scotia (Cape Breton)
) Atlantic Time - New Brunswick
) Atlantic Time - Labrador - most locations
) Atlantic Standard Time - Quebec - Lower North Shore
) Eastern Time - Ontario & Quebec - most locations
) Eastern Time - Ontario & Quebec - places that did not observe DST -
) Eastern Time - Thunder Bay, Ontario
) Eastern Time - east Nunavut - most locations
) Eastern Time - Pangnirtung, Nunavut
) Central Time - Resolute, Nunavut
) Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut
) Central Time - central Nunavut
) Central Time - Manitoba & west Ontario
) Central Time - Rainy River & Fort Frances, Ontario
) Central Standard Time - Saskatchewan - most locations
) Central Standard Time - Saskatchewan - midwest
) Mountain Time - Alberta, east British Columbia & west Saskatchewan
) Mountain Time - west Nunavut
) Mountain Time - central Northwest Territories
) Mountain Time - west Northwest Territories
) Mountain Standard Time - Creston, British Columbia
) Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia
) Mountain Standard Time - Fort Nelson, British Columbia
) Pacific Time - west British Columbia
) Pacific Time - south Yukon
) Pacific Time - north Yukon
#? 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 :: CST .
Universal Time is now: Fri Dec :: UTC .
Is the above information OK?
) Yes
) No
#? 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 :: CST
mag-sit@mag-sit:~$ date -R
Fri, Dec :: -