The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


tzset - set time zone conversion information


#include <time.h>

void tzset (void);
extern char *tzname[];
extern long int timezone;
extern int daylight;


The tzset() function uses the value of the environment variable TZ to set time conversion information used by localtime(), ctime(), strftime() and mktime(). If TZ is absent from the environment, implementation-dependent default time zone information is used.

The tzset() function sets the external variable tzname as follows:

tzname[0] = "std";
tzname[1] = "dst";

where std and dst are as described in the XBD specification, Environment Variables .

The tzset() function also sets the external variable daylight to 0 if Daylight Savings Time conversions should never be applied for the time zone in use; otherwise non-zero. The external variable timezone is set to the difference, in seconds, between Coordinated Universal Time (UTC) and local standard time, for example:

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


The tzset() function returns no value.


No errors are defined.








ctime(), localtime(), mktime(), strftime(), <time.h>.


Derived from Issue 1 of the SVID.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]