help to new C programmer with time.h

Steve Summit scs at adam.mit.edu
Sat Mar 2 03:51:32 AEST 1991


In article <1991Mar1.071615.18895 at athena.mit.edu> jik at athena.mit.edu (Jonathan I. Kamens) writes:
>   First of all, this is an OS-specific question, not a C question, because
>the C language does not define how to get the time; any functions for getting
>the time in C are OS-specific library functions, not standard C functions. 

Surprisingly enough, the functions time() and ctime() (as well as
asctime, localtime, gmtime, and the new, more flexible strftime),
*are* in the ANSI C Standard, X3.159.  (See section 4.12 .)
Therefore, these functions *should* be used in C programs which
wish to manipulate dates and times, in preference to the redundant,
system-specific, nonportable alternatives several vendors
incongruously provide.

                                            Steve Summit
                                            scs at adam.mit.edu



More information about the Comp.unix.programmer mailing list