/etc/localtime의 내용을 확인하는 방법은 무엇입니까?

/etc/localtime의 내용을 확인하는 방법은 무엇입니까?

/etc/localtime예를 들어 또는 아래의 시간대 파일 내용을 검사하려면 어떤 명령을 사용할 수 있습니까 /usr/share/zoneinfo/*?

답변1

가장 적절한 명령은 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

답변2

### For OpenWrt only ### Fixes /etc/TZ and /etc/localtime

curl -so - https://who.is/whois-ip/ip-address/`curl -s ifconfig.me`|\
    egrep 'Country:|City:'

IAMIN=Europe/Amsterdam
tail -1 /usr/share/zoneinfo/$IAMIN | tee /tmp/TZ
ln -s /usr/share/zoneinfo/$IAMIN /tmp/localtime

답변3

tzdump를 사용해 보세요. 여기에서 찾았습니다.http://www.cise.ufl.edu/~seeger/dist/tzdump.c C 프로그램이므로 컴파일이 필요합니다.

관련 정보