Xref: utzoo comp.lang.c:36668 comp.unix.programmer:1194 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!snorkelwacker.mit.edu!bloom-picayune.mit.edu!news From: scs@adam.mit.edu (Steve Summit) Newsgroups: comp.lang.c,comp.unix.programmer Subject: Re: help to new C programmer with time.h Summary: not OS-specific after all Message-ID: <1991Mar1.165132.7053@athena.mit.edu> Date: 1 Mar 91 16:51:32 GMT References: <5284@vela.acs.oakland.edu> <1991Mar1.071615.18895@athena.mit.edu> Sender: news@athena.mit.edu (News system) Reply-To: scs@adam.mit.edu Organization: Thermal Technologies, Cambridge, MA Lines: 15 In article <1991Mar1.071615.18895@athena.mit.edu> jik@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@adam.mit.edu