Home

tzname0

tzname0 is a commonly used shorthand referring to the first element of the tzname array in many C and POSIX environments. The tzname array typically consists of two strings: tzname[0] contains the abbreviation for standard time, and tzname[1] contains the abbreviation for daylight saving time (if DST is observed). In practice, tzname0 is used to denote tzname[0], the standard-time name currently in effect for the active time zone.

The values of tzname and tzname0 are determined by the system’s time zone data and are initialized

Platform differences exist. In POSIX and most Unix-like systems, extern char *tzname[2] is declared in time.h.

Usage considerations. Relying on tzname0 for portable code is discouraged; it is better to use standard, portable

See also TZ environment variable, tzset, strftime, time.h, _tzname.

when
a
program
starts
or
when
the
tzset
function
is
invoked.
This
initialization
may
rely
on
the
TZ
environment
variable
or
on
the
system’s
time
zone
database.
As
a
result,
the
actual
strings
(for
example,
"EST",
"CET",
"GMT"
or
"UTC")
depend
on
the
locale,
the
time
zone,
and
whether
DST
rules
apply.
Windows
uses
a
separate
symbol,
_tzname[2],
as
part
of
its
C
runtime.
Because
tzname
is
not
part
of
the
ISO
C
standard,
its
presence
and
exact
behavior
are
implementation-defined
and
can
vary
between
platforms
and
libraries.
facilities
such
as
strftime
with
the
%Z
format
specifier
to
obtain
the
time
zone
abbreviation,
or
to
query
TZ
and
DST
rules
through
well-supported
APIs.
Reading
tzname[0]
directly
may
also
raise
concerns
about
thread
safety
and
consistency
across
library
versions.