1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-23 19:16:11 +00:00
Files
amiga-tz/newctime.3
Arthur David Olson 6f3e336c28 -ltz -> -lz
SCCS-file: newctime.3
SCCS-SID: 2.5
2012-07-18 03:01:39 -04:00

99 lines
1.9 KiB
Groff

.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
.I Localtime
has the same argument and return value as
the older version 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 appropriate 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 Ctime
returns
.IR "asctime(localtime(*clock))" .
.PP
.I Zonetime
converts the argument time using the argument zone.
.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%