Returns the name of the time zone that is associated with the first parameter.
Berkeley compatibility library (libbsd.a) (for the timezone subroutine only)
#include <time.h>
char *timezone(zone, dst)
int zone;
int dst;
#include <time.h>
#include <limits.h>
int zone;
int dst;
The timezone subroutine returns the name of the time zone that is associated with the zone parameter. The zone parameter is measured in minutes westward from Greenwich. If the TZ environment variable is set, the zone parameter is ignored, and the current time zone is calculated from the value of the TZ environment variable. If the value of the dst parameter is 0, the standard name is returned; otherwise the name of daylight saving time is returned. If the TZ environment variable is not set, the internal table is searched for a matching time zone. If the time zone does not appear in the built in table, the difference from GMT is produced.
The timezone subroutine returns a pointer to static data, which will be overwritten by subsequent calls.
Item | Description |
---|---|
zone | Specifies minutes westward from Greenwich. |
dst | Specifies whether to return standard time or daylight saving time. |
The timezone subroutine returns a pointer to the czone global variable, which contains the name of the time zone.