TZFILE

Section: File Formats (5)
Index Return to Main Contents
 

NAME

tzfile - time zone information  

SYNOPSIS

#include "tzfile.h"  

DESCRIPTION

The time zone information files used by settz(3) and newlocaltime(3) begin with a tzinfo structure (as defined in the include file "tzfile.h"):

struct tzhead {
     char            tzh_reserved[14];
     unsigned short  tzh_timecnt;
     unsigned short  tzh_typecnt;
     unsigned short  tzh_charcnt;
};

The tzh_reserved element is currently unused. The tzh_timecnt element gives the number of "transition times" for which data is stored in the file; the tzh_typecnt (which must not be zero) element gives the number of "local time types" for which data is stored in the file; and the tzh_charcnt element gives the number of characters of "time zone abbreviation strings" stored in the file.

The above header is followed by tzh_timecnt values of type long, sorted in ascending 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 values of type unsigned char; each one tells which of the different types of "local time" 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;
};

In each structure, tt_gmtoff gives the number of seconds to be added to GMT, tt_isdst tells whether tm_isdst should be set by newlocaltime(3), and tt_abbrind serves as an index into the array of time zone abbreviation chaaracters that follow the ttinfo structure(s) in the file.

Newlocaltime uses the first ttinfo structure in the file if either tzh_timecnt is zero or newlocaltime's argument is less than the first transition time recorded in the file.  

SEE ALSO

settz(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 21:49:57 GMT, February 02, 2023