PreviousNext

utc_localzone(3dts)

Gets the local time zone label and offset from GMT, given UTC

Synopsis

#include <dce/utc.h>

int utc_localzone(
char *tzname,
size_t tzlen,
long *
tdf,
int *
isdst,
utc_t *
utc);

Parameters

Input

tzlen
Length of the tzname buffer.

utc
Binary timestamp. Use NULL if you want this routine to use the current time for this parameter.

Output

tzname
Character string long enough to hold the time zone label.

tdf
Longword with differential in seconds east of GMT.

isdst
Integer with a value of 0 (zero) if standard time is in effect or a value of 1 if daylight saving time is in effect.

Notes
All the output parameters are optional. No value is returned and no error occurs if the pointer is NULL.

Description
The utc_localzone( ) routine gets the local time zone label and offset from GMT, given utc.

The user's environment determines the time zone rule (details are system dependent). For example, on OSF/1 systems, the user selects a time zone by specifying the TZ environment variable. (The reference information for the localtime( ) system call, which is described in the ctime(3) reference page, provides additional information.)

If the user's environment does not specify a time zone rule, the system's rule is used (details of the rule are system dependent). For example, on OSF/1 systems, the rule in /etc/zoneinfo/localtime applies.

Return Values
~0 Indicates that the routine executed successfully.

1 Indicates an invalid time argument or an insufficient buffer.

Examples
See the sample program in the utc_gmtzone(3dts) reference page.

Related Information
Functions:

utc_anyzone(3dts)

utc_gmtzone(3dts)

utc_localtime(3dts)