guy at alum.mit.edu
Thu Jul 29 21:56:56 UTC 2004
On Jul 29, 2004, at 11:18 AM, Clive D.W. Feather wrote:
> Robert Elz said:
>> The original asctime() specified exactly what the out buffer would
> Did it? How? That is, what did old manual pages actually say?
If the FreeBSD man page repository is to be believed:
then it said:
Ctime converts a time pointed to by clock such as returned by
into ASCII and returns a pointer to a 26-character string in
lowing form. All the fields have constant width.
Sun Sep 16 01:03:52 1973\n\0
Localtime and gmtime return pointers to structures containing
ken-down time. Localtime corrects for the time zone and
light savings time; gmtime converts directly to GMT, which is
UNIX uses. Asctime converts a broken-down time to ASCII and
pointer to a 26-character string.
However, that man page has a large chunk of a BSD include file in it,
which leads one to suspect that the man page might not be the one from
However, if we go to the V7 archives at Bell Labs:
and get the section 3 bundle and extract it, we get a "ctime.3" that has
The structure declaration from the include file is:
which suggests that the BSD man page might really *be* the V7 one, as
the V7 one produces different results on different OSes as it includes
the OS's "time.h".
In any case, it says the same thing as the one from the FreeBSD site in
the paragraphs I cited above.
It doesn't *explicitly* say that the 26-character string returned by
"asctime()" has the same format as the one returned by "ctime()",
although I think they intended to imply that - at least for a "struct
tm" generated from a "time()" value. They probably didn't even think
about what would or should happen if you handed it a "struct tm" with
values that couldn't come from a "time()" value.
More information about the tz