Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

tzset - set timezone conversion information

&pagelevel(4)&pagelevel

Syntax

#include <time.h>

void tzset(void);

Description

tzset() uses the contents of the environment variable TZ to override the value of the different external variables. The tzset() function is called by getdate() and may also be called by the user.

tzset() scans the contents of the environment variable and assigns the different fields to the respective variable. For example, the setting for Central Europe would be:

MEZ-1MSZ-2,M3.5.0/02:00:00,M10.5.0/03:00:00.

The meaning is described in the manual "POSIX Basics for Users and System Administrators" [1], section "Local time in POSIX".

tzset() changes the values of the external variables timezone, altzone, daylight, and tzname.

The ctime(), localtime(), mktime(), and strftime() functions will also update these external variables as if they had called tzset().

tzset() sets the external variable daylight to 0 if no daylight saving conversion is to be processed for the specified time zone. Otherwise daylight is set to a value != 0. The external variable timezone is set to the difference, in seconds, between Coordinated Universal Time (UTC) and the local standard time.

Notes

If the TZ variable is absent from the environment, the applicable values for CET (Central European Time) are used:
MET-1DST,M3.5.0/02:00:00,M10.5.0/03:00:00.

See also

altzonectime(), daylight, environ, getdate(), gmtime(), localtime(), mktime(), strftime(), timezone, tzname