From 59638b1ccafcad4769cd496a7afa4e62c244b4e4 Mon Sep 17 00:00:00 2001 From: Dennis Ritchie Date: Sun, 18 Nov 1973 14:19:02 -0500 Subject: [PATCH] Research V4 development Work on file man/man3/ctime.3 Synthesized-from: v4 --- man/man3/ctime.3 | 118 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 man/man3/ctime.3 diff --git a/man/man3/ctime.3 b/man/man3/ctime.3 new file mode 100644 index 0000000000..60892c5323 --- /dev/null +++ b/man/man3/ctime.3 @@ -0,0 +1,118 @@ +.th CTIME III 10/15/73 +.sh NAME +ctime \*- convert date and time to ASCII +.sh SYNOPSIS +.ft B +char *ctime(tvec) +.br +int tvec[2]; +.s3 +.ft R +[from Fortran] +.br +.ft B +double precision ctime +.br +.li +... = ctime(dummy) +.s3 +int *localtime(tvec) +.br +int tvec[2]; +.s3 +int *gmtime(tvec) +.br +int tvec[2]; +.br +.ft R +.sh DESCRIPTION +.it Ctime +converts a time in the vector +.it tvec +such as returned by time (II) +into ASCII +and returns a pointer to a +character string +in the form +.s3 + Sun Sep 16 01:03:52 1973\\n\\0 +.s3 +All the fields have constant width. +.s3 +Once the time has been placed into +.it t +and +.it t+2, +this routine is callable from assembly language +as follows: +.s3 +.nf +.ft B + mov $t,\*-(sp) + jsr pc,\*_ctime + tst (sp)+ +.s3 +.ft R +.fi +and a pointer to the string is available in r0. +.s3 +The +.it localtime +and +.it gmtime +entries return integer vectors to the broken-down time. +.it Localtime +corrects for the time zone and possible daylight savings time; +.it gmtime +converts directly to GMT, which is the time UNIX uses. +The value is a pointer +to an array whose components are +.s3 +.lp +5 5 +0 seconds +.lp +5 5 +1 minutes +.lp +5 5 +2 hours +.lp +5 5 +3 day of the month (1-31) +.lp +5 5 +4 month (0-11) +.lp +5 5 +5 year \*- 1900 +.lp +5 5 +6 day of the week (Sunday = 0) +.lp +5 5 +7 day of the year (0-365) +.lp +5 5 +8 Daylight Saving Time flag if non-zero +.i0 +.s3 +The external variable +.it timezone +contains the difference, in seconds, between GMT and local +standard time (in EST, is 5*60*60); +the external variable +.it daylight +is non-zero iff the standard U.S.A. Daylight +Saving Time conversion should be applied +between the last Sundays in April and October. +The external variable +.it nixonflg +if non-zero +supersedes +.it daylight +and causes daylight time all year round. +.s3 +A routine named +.it ctime +is also available from Fortran. +Actually it more resembles the +.it time +(II) system entry in that it returns the number of seconds +since the epoch +0000 GMT Jan. 1, 1970 +(as a floating-point number). +.sh "SEE ALSO" +time(II) +.sh BUGS -- 2.20.1