ANSI C.

VLD/VMB gwyn at BRL.ARPA
Sat Nov 23 05:59:28 AEST 1985


difftime() accepts time_t arguments but returns a double.
Its result is expressed in SECONDS, whereas a time_t is not
necessarily expressed in seconds.  There is no portable way
to do simple arithmetic on general time_t values to produce
a time difference in seconds, hence difftime().

gmtime(), like time(), ctime(), and localtime(), takes a
pointer to a time_t because that's what they already do.
These functions have been defined (in UNIX at least) for a
long time (no pun intended).

Really, guys, the X3J11 committee has been doing a very nice
job, much better than "obviously didn't put much thought into
anything related to times".  Seems to me they put more thought
into it than some of their detractors..



More information about the Comp.lang.c mailing list