Ubuntu
Ubuntu TimeZone 설정 (서울 표준시)
AndrewJ
2023. 1. 6. 13:08
반응형
작성일: 2024년 2월 16일
방법 A) timedatectl 명령으로 시스템 전체의 timezone 변경하기
##
## 세계의 모든 timezone 확인하기
##
$ timedatectl list-timezones
Africa/Abidjan
Africa/Accra
...
Asia/Seoul
Asia/Shanghai
Asia/Singapore
...
##
## 서울 시간대로 변경하기
##
$ timedatectl set-timezone Asia/Seoul
##
## timezone이 잘 변경되었는지 확인한다.
##
$ timedatectl show
Timezone=Asia/Seoul
LocalRTC=no
CanNTP=yes
NTP=yes
NTPSynchronized=yes
TimeUSec=Wed 2023-03-15 09:45:38 KST
RTCTimeUSec=Wed 2023-03-15 09:45:38 KST
$ timedatectl status
Local time: Wed 2023-03-15 09:45:41 KST
Universal time: Wed 2023-03-15 00:45:41 UTC
RTC time: Wed 2023-03-15 00:45:41
Time zone: Asia/Seoul (KST, +0900)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
$
방법 B) 환경 변수로 timezone 변경하기
$ cat .bashrc
... 중간 생략 ...
export TZ=Asia/Seoul
$