Files
amiga-tz/newctime.3
T

99 lines
1.9 KiB
Plaintext
Raw Normal View History

1986-11-22 19:03:42 -05:00
.TH NEWCTIME 3
1986-02-15 15:51:49 -05:00
.SH NAME
1986-11-22 19:03:42 -05:00
settz, ctime, localtime, gmtime, asctime, zonetime, tzset \- convert date and time to ASCII
1986-02-15 15:51:49 -05:00
.SH SYNOPSIS
.nf
.B settz(zonename)
.B char *zonename;
.PP
1986-11-15 20:19:38 -05:00
.B char *ctime(clock)
1986-02-15 15:51:49 -05:00
.B long *clock;
.PP
1986-11-22 19:03:42 -05:00
.B #include <time.h>
1986-02-15 15:51:49 -05:00
.PP
1986-11-15 20:19:38 -05:00
.B struct tm *localtime(clock)
1986-02-15 15:51:49 -05:00
.B long *clock;
.PP
1986-11-22 19:03:42 -05:00
.B struct tm *gmtime(clock)
.B long *clock;
.PP
.B char *asctime(tm)
.B struct tm *tm;
1986-08-28 09:20:51 -04:00
.PP
.B struct tm * zonetime(timep, zone)
.B long *clock;
.B char *zone;
1986-11-15 20:19:38 -05:00
.PP
1986-11-22 19:03:42 -05:00
.B extern char *tzname[2];
.PP
.B void tzset()
.PP
.B cc ... -lz
1986-02-15 15:51:49 -05:00
.SH DESCRIPTION
.I Settz
1986-03-06 09:33:04 -05:00
sets time conversion information used by
1986-11-15 20:19:38 -05:00
.IR localtime .
1986-02-15 15:51:49 -05:00
If
.I zonename
begins with a slash,
it is used as the absolute pathname of the
.IR tzfile (5)-format
1986-03-06 09:33:04 -05:00
file from which to read the time conversion information;
1986-02-15 15:51:49 -05:00
if
.I zonename
begins with some other character,
1986-03-06 09:33:04 -05:00
it is used as a pathname relative to the standard time conversion information
1986-02-15 15:51:49 -05:00
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
1986-11-15 20:19:38 -05:00
.I Localtime
1986-02-15 15:51:49 -05:00
has the same argument and return value as
1986-11-15 20:19:38 -05:00
the older version described in
.IR ctime (3) .
1986-02-15 15:51:49 -05:00
If
1986-11-15 20:19:38 -05:00
.I localtime
1986-02-15 15:51:49 -05:00
is called before
.I settz
is called,
1986-11-15 20:19:38 -05:00
.I localtime
1986-02-15 15:51:49 -05:00
calls
.I settz
with the value returned by
.B
getenv("TZ").
1986-11-15 20:19:38 -05:00
.I Localtime
1986-11-22 19:03:42 -05:00
sets the appropriate element of
.B tzname
1986-02-15 15:51:49 -05:00
to a pointer to an
ASCII string that's the time zone abbreviation to be used with
1986-11-15 20:19:38 -05:00
.IR localtime 's
1986-02-15 15:51:49 -05:00
return value.
.PP
1986-11-15 20:19:38 -05:00
.I Ctime
1986-03-02 22:03:30 -05:00
returns
1986-11-15 20:19:38 -05:00
.IR "asctime(localtime(*clock))" .
1986-08-28 09:20:51 -04:00
.PP
.I Zonetime
converts the argument time using the argument zone.
1986-02-15 15:51:49 -05:00
.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
1986-11-15 20:19:38 -05:00
/etc/zoneinfo standard time conversion information directory
1986-02-15 15:51:49 -05:00
.SH "SEE ALSO"
1986-02-15 15:52:46 -05:00
ctime(3), getenv(3), tzfile(5)
1986-02-15 15:51:49 -05:00
.. %W%