tzset -- Assign Values to Locale Information

Format

#include <time.h>
void tzset(void);

Language Level: XPG4, Extension
tzset uses the environment variable TZ to change the time zone and daylight saving time (DST) zone values of your current locale. These values are used by the gmtime and localtime functions to make corrections from Universal Coordinate Time (formerly GMT) to local time.

To use tzset, set the TZ variable to the appropriate values. Then call tzset to incorporate the changes in the time zone information into your current locale.

To set TZ from within a program, use putenv before calling tzset.

Notes:

  1. In earlier releases of the C/C++ run-time library, tzset began with an underscore (_tzset). Because it is defined by the X/Open standard, the underscore has been removed. For compatibility, IBM C and C++ Compilers will map _tzset to tzset for you.
  2. The time and date functions begin at 00:00:00 Universal Coordinate Time, January 1, 1970.

Return Value
There is no return value.

Example



Application Runtime Environment Variables


asctime -- Convert Time to Character String
_ftime -- Store Current Time
gmtime -- Convert Time
localtime -- Convert Time
mktime -- Convert Local Time
putenv -- Modify Environment Variables
strftime -- Convert to Formatted Time
time -- Determine Current Time
<time.h>
TZ Environment Variable