OSWikiHK: 請協力 GPLv3 的中文翻譯工作。

設定時區

OSWikiHK,自由中文開源知識庫

Jump to: navigation, search

標準文章
作者: Roy Chan
協力: -
校對: -
級別: 初階
分享本文:

目录

設定時區

GNOME

右擊頂部面板右上角的日期時間,選『調節日期及時間』(Adjust Time & Date):

輸入密碼:

按『選取時間...』(Select Time Zone):

在地圖上點擊您所在地的時區:

您亦可以在下面『時區』(Time zone)中直接選擇您所在地的時區。

tzconfig

以系統管理員 root 身份輸入命令 tzconfig

# tzconfig
Your current time zone is set to Asia/Hong_Kong
Do you want to change that? [n]: y

Please enter the number of the geographic area in which you live:


        1) Africa                       7) Australia

        2) America                      8) Europe

        3) US time zones                9) Indian Ocean

        4) Canada time zones            10) Pacific Ocean

        5) Asia                         11) Use System V style time zones

        6) Atlantic Ocean               12) None of the above


Then you will be shown a list of cities which represent the time zone
in which they are located. You should choose a city in your time zone.

Number: 5

Aden Almaty Amman Anadyr Aqtau Aqtobe Ashgabat Ashkhabad Baghdad Bahrain
Baku Bangkok Beirut Bishkek Brunei Calcutta Choibalsan Chongqing Chungking
Colombo Dacca Damascus Dhaka Dili Dubai Dushanbe Gaza Harbin Hong_Kong
Hovd Irkutsk Istanbul Jakarta Jayapura Jerusalem Kabul Kamchatka Karachi
Kashgar Katmandu Krasnoyarsk Kuala_Lumpur Kuching Kuwait Macao Macau
Magadan Makassar Manila Muscat Nicosia Novosibirsk Omsk Oral Phnom_Penh
Pontianak Pyongyang Qatar Qyzylorda Rangoon Riyadh Riyadh87 Riyadh88
Riyadh89 Saigon Sakhalin Samarkand Seoul Shanghai Singapore Taipei
Tashkent Tbilisi Tehran Tel_Aviv Thimbu Thimphu Tokyo Ujung_Pandang
Ulaanbaatar Ulan_Bator Urumqi Vientiane Vladivostok Yakutsk Yekaterinburg
Yerevan
 
Please enter the name of one of these cities or zones
You just need to type enough letters to resolve ambiguities
Press Enter to view all of them again
Name: [] Hong
Your default time zone is set to 'Asia/Hong_Kong'.
Local time is now:      五 11月 10 02:48:15 HKT 2006.
Universal Time is now:  四 11月  9 18:48:15 UTC 2006.
#

手動設定

各地的時區資料一般都會被放在目錄 /usr/share/zoneinfo 或 /usr/lib/zoneinfo 中。您只需要建立一個由/etc/localtime 指向 /usr/share/zoneinfo/ 中對應時區檔案的軟連結 (symbolic link) 就可以了。

ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime

設定 BIOS 時間使用 UTC 時區

Debian 或 Ubuntu

在檔案 /etc/default/rcS 中,將選項 UTC 的值設定成 yes ,例如:

#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.

TMPTIME=0
SULOGIN=no
DELAYLOGIN=no
UTC=yes
VERBOSE=no
FSCKFIX=no

如果不想 BIOS 時間依 UTC 時區,可以將選項 UTC 設定為 no。

CentOS/Fedora/RHEL

在檔案 /etc/sysconfig/clock 中,將選項 UTC 的值設定成 true 或 yes,例如:

Zone="Asia/Hong_Kong"
UTC=true
ARC=false

如果不想 BIOS 時間依 UTC 時區,可以將選項 UTC 設定為 false 或 no。

相關頁面

相關連結

Personal tools