답변:
가장 적절한 명령은 zdump
입니다.
$ zdump /etc/localtime
/etc/localtime Wed Aug 7 23:52:25 2013 EDT
$ zdump /usr/share/zoneinfo/* | tail -10
/usr/share/zoneinfo/Singapore Thu Aug 8 11:52:48 2013 SGT
/usr/share/zoneinfo/Turkey Thu Aug 8 06:52:48 2013 EEST
/usr/share/zoneinfo/UCT Thu Aug 8 03:52:48 2013 UCT
/usr/share/zoneinfo/Universal Thu Aug 8 03:52:48 2013 UTC
/usr/share/zoneinfo/US Thu Aug 8 03:52:48 2013
/usr/share/zoneinfo/UTC Thu Aug 8 03:52:48 2013 UTC
/usr/share/zoneinfo/WET Thu Aug 8 04:52:48 2013 WEST
/usr/share/zoneinfo/W-SU Thu Aug 8 07:52:48 2013 MSK
/usr/share/zoneinfo/zone.tab Thu Aug 8 03:52:48 2013
/usr/share/zoneinfo/Zulu Thu Aug 8 03:52:48 2013 UTC
다음 file
명령을 사용하여 이러한 파일을 조사 할 수도 있습니다 .
$ file /etc/localtime
/etc/localtime: timezone data, version 2, 4 gmt time flags, 4 std time flags, no leap seconds, 235 transition times, 4 abbreviation chars
$ file /usr/share/zoneinfo/Singapore
/usr/share/zoneinfo/Singapore: timezone data, version 2, 8 gmt time flags, 8 std time flags, no leap seconds, 8 transition times, 8 abbreviation chars
tzdump를 사용해보십시오. 나는 그것을 여기에서 찾았다 : http://www.cise.ufl.edu/~seeger/dist/tzdump.c 그것은 C 프로그램이므로 컴파일해야한다.
단계 :
먼저 도커 컨테이너의 현지 시간을 확인하십시오.
[root@locdb oracle]# zdump /etc/localtime
/etc/localtime Tue May 22 13:59:40 2018 UTC
아래와 같이 시간대를 확인하십시오.
[root@locdb oracle]# zdump /usr/share/zoneinfo/* | tail -10
/usr/share/zoneinfo/UTC Tue May 22 14:01:21 2018 UTC
/usr/share/zoneinfo/Universal Tue May 22 14:01:21 2018 UTC
/usr/share/zoneinfo/W-SU Tue May 22 17:01:21 2018 MSK
/usr/share/zoneinfo/WET Tue May 22 15:01:21 2018 WEST
/usr/share/zoneinfo/Zulu Tue May 22 14:01:21 2018 UTC
/usr/share/zoneinfo/iso3166.tab Tue May 22 14:01:21 2018
/usr/share/zoneinfo/posix Tue May 22 14:01:21 2018
/usr/share/zoneinfo/posixrules Tue May 22 10:01:21 2018 EDT
/usr/share/zoneinfo/right Tue May 22 14:01:21 2018
/usr/share/zoneinfo/zone.tab Tue May 22 14:01:21 2018
예를 들어 필요한 것을 복사하십시오.
cp /usr/share/zoneinfo/UTC /etc/localtime
docker
여기에 언급하는 것은 일반적인 해결책에서 산만 하다고 생각 합니다.
apropos -s 1 -a time zone