Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ctime(III) — UNIX 6th Edition

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

time(II)

CTIME(III)  −  PWB/UNIX 10/15/73

NAME

ctime, localtime, gmtime  −  convert date and time to ASCII

SYNOPSIS

char *ctime(tvec)
int tvec[2]; [from Fortran]
double precision ctime
int *localtime(tvec)
int tvec[2]; int *gmtime(tvec)
int tvec[2];

DESCRIPTION

Ctime converts a time in the vector tvec such as returned by time (II) into ASCII and returns a pointer to a character string in the form     Sun Sep 16 01:03:52 1973\n\0 All the fields have constant width. The localtime and gmtime entries return pointers to integer vectors containing the broken-down time.  Localtime corrects for the time zone and possible daylight savings time; gmtime converts directly to GMT, which is the time UNIX uses.  The value is a pointer to an array whose components are

0seconds

1minutes

2hours

3day of the month (1-31)

4month (0-11)

5year − 1900

6day of the week (Sunday = 0)

7day of the year (0-365)

8Daylight Saving Time flag if non-zero

The external variable timezone contains the difference, in seconds, between GMT and local standard time (in EST, is 5*60*60); the external variable daylight is non-zero iff the standard U.S.A. Daylight Savings Time conversion should be applied.  The program knows about the peculiarities of this conversion in 1974 and 1975; if necessary, a table for these years can be extended.  A routine named ctime is also available from Fortran.  Actually it more resembles the 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). 

SEE ALSO

time(II)

BUGS

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026