Home

TZNAME

TZNAME is a term used in many C library implementations to refer to the two strings that denote the time zone abbreviations used for standard time and daylight saving time. In most systems these abbreviations are exposed as a two-element array of pointers to char named tzname: tzname[0] is the standard time abbreviation, and tzname[1] is the daylight saving time abbreviation. The array is populated by tzset(), which reads the active time zone specification from the TZ environment variable or the system time zone database.

Initialization and usage: When tzset is invoked, it parses the time zone information and fills tzname accordingly.

Portability and variations: The existence and naming of TZNAME are not guaranteed by the C standard. POSIX

Notes: Access to tzname can be affected by calls to tzset, and in some implementations the array

See also: TZ environment variable, tzset, localtime, time.h, strftime, timezone.

After
successful
initialization,
time
conversion
functions
such
as
localtime
use
the
tzname
values
to
describe
the
local
zone
in
formatting
operations.
The
actual
abbreviations
depend
on
the
configured
time
zone
data;
common
examples
include
names
like
“EST”/“EDT”
or
“PST”/“PDT”.
does
not
require
tzname;
some
platforms
provide
it
as
extern
char
*tzname[2],
while
others
may
use
different
symbols
(for
example,
Windows
environments
may
expose
_tzname).
In
practice,
most
code
relies
on
tzname
(lowercase)
or
uses
strftime
with
%Z
to
obtain
the
zone
name,
which
can
be
more
portable
across
platforms.
may
be
overwritten
by
subsequent
tzset
calls,
affecting
thread
safety.
For
robust
programming,
rely
on
standard
time
formatting
facilities
when
possible
and
be
aware
of
platform-specific
behavior
regarding
time
zone
naming.