[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Zeitzonenverwirrung



Hallo,

Heiko Schlittermann schrieb am Mittwoch, den 27.07.2011 um 10:38:
> Hallo,
> 
> ich bin etwas verwirrt. Oder nur schlecht informiert.
> 
> Ausgangspunkt: ich habe in /etc/localtime die Beschreibung
> für meine aktuelle Zeitzone (Europe/Berlin, MEST, …)
> 
>     # date
>     Wed Jul 27 10:00:26 CEST 2011
> 
> Das stimmt soweit. Jetzt meinte ich, daraus meine Zeitzone ableiten zu
> können: „CEST“.
> 
>     # TZ=CEST date
>     Wed Jul 27 08:03:20 CEST 2011
> 
> Aber, das liegt knapp daneben, es ist UTC, etwas irreführend aber als
> CEST deklariert. Noch ein weiterer Versuch:
> 
>     # TZ=XXX date
>     Wed Jul 27 08:03:50 XXX 2011
> 
> Meckert nicht, ist aber nicht minder Quatsch.

Dieses Verhalten entspricht der Dokumentation (man 3 timezone):

    If the TZ variable does appear in the environment but its value 
    … cannot be interpreted using any of the formats specified below, 
    Coordinated Universal Time (UTC) is used.
    …
    The third format specifies that the timezone information should be read
    from a file:

           :[filespec]

    If the file specification filespec is omitted, the timezone information
    is read from the file localtime in the system timezone directory, which
    nowadays usually is /usr/share/zoneinfo.  This  file  is  in  tzfile(5)
    format.   If  filespec  is given, it specifies another tzfile(5)-format
    file to read the timezone information from.  If filespec does not begin
    with  a  '/', the file specification is relative to the system timezone
    directory.

    Here's an example, once more for New Zealand:

    TZ=":Pacific/Auckland"

> Offenbar liegt es an fehlenden Links in /usr/share/zoneinfo. Warum gibt
> es dort keine Links für die vielen Zonenabkürzungen? Weiß das jemand?

Ich nicht.  Vermutungen:  Vielleicht weil es zu unübersichtlich wäre?  
Oder weil die Abkürzungen nicht alle eindeutig sind?  Wer weiß.

> Wie finde ich nun fehlerfrei raus, welche Zeitzone HKT ist, bzw. welches
> Zoneinfo-File damit korrespondiert?

Zum Beispiel:

    TZ=":Asia/Hong_Kong" date liefert Mi 27. Jul 17:14:37 HKT 2011
 
aber das beantwortet Deine Frage vermutlich nicht.

> Nein, in /usr/share/zoneinfo möchte ich nicht „greppen“, erstens ist das
> dort nur Ameisenkacke, zweitens kann das Verzeichnis auf einem anderen
> System woanders liegen. Auch die Quellen von „tzdata“ möchte ich nicht
> zu Rate ziehen. 

Dann habe ich keine Lösung dafür.  Jemand anders?

Mit freundlichen Grüßen,
Peter Funk
-- 
Peter Funk, home: ✉Oldenburger Str.86, D-27777 Ganderkesee
mobile:+49-179-640-8878 phone:+49-421-20419-0 <http://www.artcom-gmbh.de/>
office: ArtCom GmbH, ✉Haferwende 2, D-28357 Bremen, Germany


Reply to: