tzfileのヘルプ・マニュアル
日本語 英語
tzfile --help
man tzfile
TZFILE(5) Linux Programmer’s Manual TZFILE(5)
名前
tzfile - タイムゾーンの情報
書式
#include
説明
tzset(3) によって用いられるタイムゾーン情報のファイルは、識別のための
magic 文字列 "TZif" で始まり、将来のための 16 バイトの予約領域が続き 、
long 型の 4 バイトの値が 6 個続く。この値は「標準」バイトオーダー (高位
バイトが先に書かれる) で記述される。これらの値は、順に以下のようなも の
である。
tzh_ttisgmtcnt
ファイルに記述されている UTC/local インジケータ (indicator) の個
数。
tzh_ttisstdcnt
ファイルに記述されている standard/wall インジケータの個数。
tzh_leapcnt
ファイルに記述されている閏秒データの個数。
tzh_timecnt
ファイルに記述されている「遷移時間 (transition time)」データの個
数。
tzh_typecnt
フ ァイルに記述されている「ローカル時間型 (local time types)」デ
ータの個数 (0 であってはいけない)。
tzh_charcnt
ファイルに記述されている「タイムゾーン 略 式 文 字 列 (timezone
abbreviation string)」の個数。
上 記のヘッダに続いて tzh_timecnt という 4 バイトの long 型の値が (複数
個) 続く。昇順で保管されている。これらの値は「標準」バイトオーダーで 記
述 されている。それぞれは遷移時間 (time(2) が返す値) として用いられ、そ
れぞれにおいてローカル時間の計算ルールが変更される 。 次 に 来 る の は
tzh_timecnt で、これは unsigned char 型の 1 バイトの値である (複数個続
くこともある)。この値は、ファイルで記述されている異なったタイプの「ロー
カ ル時間」が、それぞれ同じようにインデックスされた遷移時間のどれに関連
づけられているかを示す。これらの値は ttinifo 構造体の配列に対するインデ
ッ クスとして提供されている。 ttinfo 構造体はファイル中で次の位置に置か
れる。この構造体は以下のように定義されている:
struct ttinfo {
long tt_gmtoff;
int tt_isdst;
unsigned int tt_abbrind;
};
それぞれの構造体は、 4 バイトの long 型の値 tt_gmtoff、 1 バイ ト の 値
tt_isdst, 1 バイトの値 tt_abbrind から構成される。それぞれの構造体にお
いて、 tt_gmtoff は UTC に加えるべき秒数を与え、 tt_isdst は tm_isdst
を localtime(3) にセットすべきかどうかを示し、 tt_abbrind はファイル中
で ttinfo 構造体 (配列) のあとに置かれるタイムゾーン略式文字列の配列 に
対するインデックスである。
次 には 4 バイト値のペアである tzh_leapcnt が (複数個) 続く。標準バイト
オーダーで記述される。それぞれのペアの最初の値は閏秒の起きた時 刻 を (
time(2) の返す形式で) 与え、二番目の値はその時刻に加えるべき閏秒数の全
秒数を与える。これらのペアは時刻の古い順に記述する。
次には tzh_ttisstdcnt が置かれる。これは standard/wall インジケータで、
それぞれ 1 バイトの値を保管する。これらはローカル時間のタイプに関連づけ
られた遷移時間が標準時刻 (standard time) と壁時計時刻 (wall clock time)
のどちらで指定されているかを示す。またこの値は、 POSIX スタイルのタイム
ゾーン環境変数を処理するときにタイムゾーンファイルが使われるときにも 利
用される。
最後に tzh_ttisgmtcnt が置かれる。これは UTC/local インジケータで、それ
ぞれ 1 バイトの値を保管する。これらはローカル時間のタイプに関連づけられ
た遷移時間が UTC とローカル時刻のどちらで指定されているかを示す。またこ
の値は、 POSIX スタイルのタイムゾーン環境変数を処理するときにタイムゾー
ンファイルが使われるときにも利用される。
localtime は、 tzh_timeout が 0 であるか time 引数がファイルに記録され
ていた最初の遷移時刻よりも小さい場合には、ファイルに最初に現れる標準 時
刻 の ttinfo 構造体を使う (または標準時刻の構造体がない場合は、単に最初
の ttinfo 構造体を使う)。
1996-06-05 TZFILE(5)
TZFILE(5) Linux Programmer’s Manual TZFILE(5)
NAME
tzfile - timezone information
SYNOPSIS
#include
DESCRIPTION
The timezone information files used by tzset(3) begin with the magic
characters "TZif" to identify then as timezone information files, fol-
lowed by sixteen bytes reserved for future use, followed by six four-
byte values of type long, written in a "standard" byte order (the high-
order byte of the value is written first). These values are, in order:
tzh_ttisgmtcnt
The number of UTC/local indicators stored in the file.
tzh_ttisstdcnt
The number of standard/wall indicators stored in the file.
tzh_leapcnt
The number of leap seconds for which data is stored in the file.
tzh_timecnt
The number of "transition times" for which data is stored in the
file.
tzh_typecnt
The number of "local time types" for which data is stored in the
file (must not be zero).
tzh_charcnt
The number of characters of "timezone abbreviation strings"
stored in the file.
The above header is followed by tzh_timecnt four-byte values of type
long, sorted in ascending order. These values are written in "stan-
dard" byte order. Each is used as a transition time (as returned by
time(2)) at which the rules for computing local time change. Next come
tzh_timecnt one-byte values of type unsigned char; each one tells which
of the different types of "local time" types described in the file is
associated with the same-indexed transition time. These values serve
as indices into an array of ttinfo structures that appears next in the
file; these structures are defined as follows:
struct ttinfo {
long tt_gmtoff;
int tt_isdst;
unsigned int tt_abbrind;
};
Each structure is written as a four-byte value for tt_gmtoff of type
long, in a standard byte order, followed by a one-byte value for
tt_isdst and a one-byte value for tt_abbrind. In each structure,
tt_gmtoff gives the number of seconds to be added to UTC, tt_isdst
tells whether tm_isdst should be set by localtime(3), and tt_abbrind
serves as an index into the array of timezone abbreviation characters
that follow the ttinfo structure(s) in the file.
Then there are tzh_leapcnt pairs of four-byte values, written in stan-
dard byte order; the first value of each pair gives the time (as
returned by time(2)) at which a leap second occurs; the second gives
the total number of leap seconds to be applied after the given time.
The pairs of values are sorted in ascending order by time.
Then there are tzh_ttisstdcnt standard/wall indicators, each stored as
a one-byte value; they tell whether the transition times associated
with local time types were specified as standard time or wall clock
time, and are used when a timezone file is used in handling POSIX-style
timezone environment variables.
Finally, there are tzh_ttisgmtcnt UTC/local indicators, each stored as
a one-byte value; they tell whether the transition times associated
with local time types were specified as UTC or local time, and are used
when a timezone file is used in handling POSIX-style timezone environ-
ment variables.
Localtime uses the first standard-time ttinfo structure in the file (or
simply the first ttinfo structure in the absence of a standard-time
structure) if either tzh_timecnt is zero or the time argument is less
than the first transition time recorded in the file.
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
1996-06-05 TZFILE(5)