ANSI C date & time library functions.

Speaker-To-Animals dave at moncam.co.uk
Tue Feb 6 22:25:02 AEST 1990


I am writing an implementation of the ANSI C date and time functions.
Unfortunately, I don't have a copy of the standard itself yet, so I'm
working from K&R2.  time_t is described as a scalar type.  difftime() returns
the difference between two times as a double.  If time_t represents a time
in centiseconds (say), a 32-bit unsigned value will cover a period of a year
or so.  Are times more precise than 1 second only possible in implementations 
with greater than 32 bit integers?  Since time() returns -1 if the time is
not available, it doesn't seem possible to define time_t as an array of
integers.
--
Dave Allen
Monotype International ADG
Science Park
Milton Road
Cambridge CB4 4FQ
England

dave at moncam.UUCP



More information about the Comp.std.c mailing list