[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 2

timezone Subroutine

Attention: Do not use the tzset subroutine, from libc.a, when linkning libc.a libbsd.a. The tzset subroutine uses the global external variable timezone which conflicts with the timezone subroutine in libbsd.a. This name collision can cause unpredictable results.

Purpose

Returns the name of the timezone associated with the first arguement.

Library

Berkeley compatability library (libbsd.a) (for timezone only)

Syntax

#include <time.h>
char *timezone(zone, dst)
int zone;
int dst;
#include <time.h>
#include <limits.h>
int zone;
int dst;
char czone[TZNAME_MAX+1];

Description

The timezone subroutine returns the name of the timezone associated with the first argument which is measured in minutes westward frow Greenwich. If the environment variable TZ is set, the first argument is ignored and the current timezone is calculated from the value of TZ. If the second argument is 0, the standard name is returned otherwise the Daylight Saving Time name is returned. If TZ is not set, then the internal table is searched for a matching timezone. If the timezone does not appear in the built in table then difference from GMT is produced.

Timezone returns a pointer to static data that will be overwritten by subsequent calls.

Parameters

zone Specifies minutes westward from Greenwich.
dst Specifies whether to return Standard time or Daylight Savings time.
czone Specifies a buffer of size TZNAME_MAX+1, that the result is placed in.

Return Values

timezone returns a pointer to static data that contains the name of the timezone.

Errors

There are no errors defined.

Implementations Specifics

These subroutines are part of Base Operation System (BOS) Runtime.

Related Information

Subroutines Overview

List of Multi-threaded Programming Subroutines


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]