본문 바로가기

728x90

localtime

timedatectl 명령어 timedatectl 명령어 timedatectl 명령어는 시스템의 시간 및 날짜 설정을 관리하는데 사용되는 Linux 시스템 명령어입니다. 이 명령어를 사용하면 시스템 시간, 날짜, 시간대 등을 설정하고 확인할 수 있습니다. 일반적으로 timedatectl 명령어를 사용할 때 아래와 같은 옵션을 사용할 수 있습니다. status: 현재 시간 및 날짜 설정 상태를 보여줍니다. set-time YYYY-MM-DD: 시스템 날짜를 지정한 날짜로 설정합니다. set-time HH:MM:SS: 시스템 시간을 지정한 시간으로 설정합니다. set-timezone TIMEZONE: 시스템 시간대를 설정합니다. 예: Asia/Seoul. list-timezones: 사용 가능한 시간대 목록을 표시합니다. timedat.. 더보기
도커 컨테이너에서 타임존을 설정하는 방법 도커 컨테이너에서 타임존을 설정하는 방법(timezone)현재 타임존 확인timedatectl타임존 설정(Asia/Seoul)sudo timedatectl set-timezone Asia/Seoul심볼릭 링크(/etc/localtime 파일을 직접 설정)sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtimedocker run 명령을 통한 타임존 설정컨테이너를 실행할 때 환경 변수를 사용하여 타임존을 설정할 수 있습니다.docker run -it --rm -v /usr/share/zoneinfo/Asia/Seoul:/etc/localtime:ro centos bash$ docker run -it --rm -v /usr/share/zoneinfo/Asia/Se.. 더보기
[리눅스] localtime 한국(서울)로 변경하기 localtime 한국(서울)로 변경하기 localtime # ls -al /etc/localtime -rw-r--r-- 1 root root 3519 Feb 26 2006 /etc/localtime 한국(서울) localtime 으로 변경하기 # ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime # ls -al /etc/localtime lrwxrwxrwx 1 root root 30 May 15 01:02 /etc/localtime -> /usr/share/zoneinfo/Asia/Seoul 시간 동기화 rdate -s time.bora.net && clock -w 더보기

반응형