Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

Guardian Native C Library Calls (t - z) tzset(3)
NAME
tzset - Converts time units
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <time.h>
void tzset(void);
extern char *tzname[];
extern long int timezone;
extern int daylight;
DESCRIPTION
The tzset( ) function uses the value of the environment variable TZ to set time conversion infor-
mation used by the localtime(), ctime(), strftime( ), and mktime() functions. When environ-
ment variable TZ is not defined, implementation-defined default time-zone information is used.
When the environment variable TZ is defined, the defined value overrides the default time-zone
value. The environment facility contains formatted time-zone information specified by TZ. TZ
is usually set when a shell is started, with the value that is in the /etc/profile or .profile file.
However, TZ can also be set by a user for converting to alternate time zones.
The tzset( ) function sets the external variable tzname as follows:
tzname[0] = std ;
tzname[1] = dst ;
where std and dst are the strings designating a standard time zone and daylight-saving time zone,
respectively, as described for the TZ environment variable.
The tzset( ) function also sets the external variable daylight to 0 (zero) when daylight-saving
time conversions should never be applied for the time zone in use; otherwise, daylight is set to a
nonzero value. The external variable timezone is set to the difference, in seconds, between
Coordinated Universal Time (UTC) and local standard time.
In the following table, entries in the TZ column are time-zone environmental variables and
entries in the Timezone column are time units expressed as UTC time.
TZ Timezone
__________________
EST 5*60*60
GMT 0*60*60
JST -9*60*60
MET -1*60*60
MST 7*60*60
PST 8*60*60
__________________
External variable tzname specifies the name of the standard time zone (tzname[0]) and of the
time zone when daylight-saving time is in effect (tzname[1]). For example:
extern char *tzname[2] = {"EST","EDT"};
External variable timezone specifies the difference, in seconds, between UTC and local standard
time. For example, the value of timezone is 5 * 60 * 60 for U.S. Eastern standard time.
527192-018 Hewlett-Packard Company 751