Files
amiga-tz/newctime.3
T
Arthur David Olson ef42c0a5c7 fixes from guy@sun
SCCS-file: newctime.3
SCCS-SID: 2.7
2012-07-18 03:01:40 -04:00

113 lines
2.1 KiB
Plaintext

.TH NEWCTIME 3
.SH NAME
settz, ctime, localtime, gmtime, asctime, zonetime, tzset \- convert date and time to ASCII
.SH SYNOPSIS
.nf
.B settz(zonename)
.B char *zonename;
.PP
.B char *ctime(clock)
.B long *clock;
.PP
.B #include <time.h>
.PP
.B struct tm *localtime(clock)
.B long *clock;
.PP
.B struct tm *gmtime(clock)
.B long *clock;
.PP
.B char *asctime(tm)
.B struct tm *tm;
.PP
.B struct tm * zonetime(timep, zone)
.B long *clock;
.B char *zone;
.PP
.B extern char *tzname[2];
.PP
.B void tzset()
.PP
.B cc ... -lz
.SH DESCRIPTION
.I Settz
sets time conversion information used by
.IR localtime .
If
.I zonename
begins with a slash,
it is used as the absolute pathname of the
.IR tzfile (5)-format
file from which to read the time conversion information;
if
.I zonename
begins with some other character,
it is used as a pathname relative to the standard time conversion information
directory. A call of the form
.ti +.5i
.B
settz("")
.br
causes built-in information about GMT to be used; a call of the form
.ti +.5i
.B
settz((char *) 0)
.br
is treated as if it were a call of the form
.ti +.5i
.B
settz("localtime")
.PP
.IR Ctime ,
.IR localtime ,
.IR gmtime ,
and
.I asctime
have the same arguments and return values as
the seasoned versions described in
.IR ctime (3) .
If
.I localtime
is called before
.I settz
is called,
.I localtime
calls
.I settz
with the value returned by
.B
getenv("TZ").
.I Localtime
sets the
.BR tm_isdst 'th
element of
.B tzname
to a pointer to an
ASCII string that's the time zone abbreviation to be used with
.IR localtime 's
return value.
.PP
.I Zonetime
converts the argument time using the argument zone,
without affecting the zone used in future
.I localtime
calls.
.PP
.I Tzset
simply calls
.I settz
with the value of the environment variable
.SM
.B TZ
as an argument or, if TZ is not present in the
environment, a null pointer as an argument.
.SH DIAGNOSTICS
.I Settz
returns zero if all seems well; it returns negative one otherwise
(and sets things up so that its built-in information about GMT is used).
.SH FILES
/etc/zoneinfo standard time conversion information directory
.SH "SEE ALSO"
ctime(3), getenv(3), tzfile(5)
.. %W%