우분투에서 시간대(Timezone) 변경하기

Ubuntu(우분투)에서 타임존(시간대)을 변경하는 방법을 소개합니다.

  • GUI : Settings에서 타임존 변경
  • Terminal : 쉘 명령어로 타임존 변경

1. 현재 시간, 타임존 확인 방법

터미널에서 date를 입력하면 현재 날짜, 시간 및 타임존이 나옵니다. KST(한국 표준시)가 현재 설정된 타임존입니다.

$ date
Fri 25 Feb 2022 08:57:45 AM KST

2. GUI : Settings에서 타임존 변경

Settings에서 Date & Time 설정에 들어가면 Time Zone 변경 메뉴가 있습니다. Ubuntu Settings Timezone

Time Zone 버튼을 누르시면 아래와 같이 원하는 시간대로 변경할 수 있습니다. Ubuntu Settings Timezone

JST로 변경하고 다시 터미널에서 date를 입력하면 타임존이 변경된 것을 확인할 수 있습니다.

$ date
Fri 25 Feb 2022 08:51:55 AM JST

3. Terminal : 쉘 명령어로 타임존 변경

터미널에서 명령어로 타임존을 변경할 수 있습니다.

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							     7) Europe
2) Americas							     8) Indian Ocean
3) Antarctica							     9) Pacific Ocean
4) Asia								    10) coord - I want to use geographical coordinates.
5) Atlantic Ocean						    11) TZ - I want to specify the timezone using the Posix TZ format.
6) Australia
#? 4
Please select a country whose clocks agree with yours.
1) Afghanistan		   9) Cambodia		    17) Iran		      25) Kuwait		33) Nepal		  41) Singapore		    49) Uzbekistan
2) Antarctica		  10) China		    18) Iraq		      26) Kyrgyzstan		34) Oman		  42) Sri Lanka		    50) Vietnam
3) Armenia		  11) Cyprus		    19) Israel		      27) Laos			35) Pakistan		  43) Syria		    51) Yemen
4) Azerbaijan		  12) East Timor	    20) Japan		      28) Lebanon		36) Palestine		  44) Taiwan
5) Bahrain		  13) Georgia		    21) Jordan		      29) Macau			37) Philippines		  45) Tajikistan
6) Bangladesh		  14) Hong Kong		    22) Kazakhstan	      30) Malaysia		38) Qatar		  46) Thailand
7) Bhutan		  15) India		    23) Korea (North)	      31) Mongolia		39) Russia		  47) Turkmenistan
8) Brunei		  16) Indonesia		    24) Korea (South)	      32) Myanmar (Burma)	40) Saudi Arabia	  48) United Arab Emirates
#? 24

The following information has been given:

	Korea (South)

Therefore TZ='Asia/Seoul' will be used.
Selected time is now:	Fri 25 Feb 2022 08:55:26 AM KST.
Universal Time is now:	Thu 24 Feb 2022 11:55:26 PM UTC.
Is the above information OK?
1) Yes
2) No
#? 1

You can make this change permanent for yourself by appending the line
	TZ='Asia/Seoul'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

변경 후, 다시 date를 입력하여 시간대가 변경되었는지 확인할 수 있습니다.

$ date
Fri 25 Feb 2022 08:57:45 AM KST
Loading script...

Related Posts

codechachaCopyright ©2019 codechacha