From: Tom London Date: Sat, 9 Dec 1978 03:46:01 +0000 (-0500) Subject: Bell 32V development X-Git-Tag: Bell-32V~484 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/e2137ef34b3b85b8c65d7b1c78451aa7bd38bf8f?hp=4a407f71b95dc214e51108e0b724ec546044dc76 Bell 32V development Work on file usr/man/man3/ctime.3 Co-Authored-By: John Reiser Synthesized-from: 32v --- diff --git a/usr/man/man3/ctime.3 b/usr/man/man3/ctime.3 new file mode 100644 index 0000000000..cf0da08681 --- /dev/null +++ b/usr/man/man3/ctime.3 @@ -0,0 +1,91 @@ +.TH CTIME 3 +.SH NAME +ctime, localtime, gmtime, asctime, timezone \- convert date and time to ASCII +.SH SYNOPSIS +.B char *ctime(clock) +.br +.B long *clock; +.PP +.B #include +.PP +.B struct tm *localtime(clock) +.br +.B long *clock; +.PP +.B struct tm *gmtime(clock) +.br +.B long *clock; +.PP +.B char *asctime(tm) +.br +.B struct tm *tm; +.PP +.B char *timezone(zone, dst) +.SH DESCRIPTION +.I Ctime +converts a time pointed to by +.I clock +such as returned by +.IR time (2) +into ASCII +and returns a pointer to a +26-character string +in the following form. +All the fields have constant width. +.PP + Sun Sep 16 01:03:52 1973\\n\\0 +.PP +.I Localtime +and +.I gmtime +return pointers to structures containing +the broken-down time. +.I Localtime +corrects for the time zone and possible daylight savings time; +.I gmtime +converts directly to GMT, which is the time UNIX uses. +.I Asctime +converts a broken-down time to ASCII and returns a pointer +to a 26-character string. +.PP +The structure declaration from the include file is: +.RS +.PP +.nf +.so /usr/include/time.h +.fi +.RE +.PP +These quantities give the time on a 24-hour clock, +day of month (1-31), month of year (0-11), day of week +(Sunday = 0), year \- 1900, day of year (0-365), +and a flag that is nonzero if daylight saving time is in effect. +.PP +When local time is called for, +the program consults the system to determine the time zone and +whether the standard U.S.A. daylight saving time adjustment is +appropriate. +The program knows about the peculiarities +of this conversion in 1974 and 1975; +if necessary, +a table for these years can be extended. +.PP +.I Timezone +returns the name of the time zone associated with its first argument, +which is measured in minutes westward from Greenwich. +If the second argument is 0, the standard name is used, +otherwise the Daylight Saving version. +If the required name does not appear in a table +built into the routine, +the difference from GMT is produced; e.g. +in Afghanistan +.I timezone(-(60*4+30), 0) +is appropriate because it is 4:30 ahead of GMT +and the string +.B GMT+4:30 +is produced. +.SH "SEE ALSO" +time(2) +.SH BUGS +The return values point to static data +whose content is overwritten by each call.