time Overview time
COHERENT includes a number of routines that allow you to set and
manipulate time, as recorded on the system's clock, into a
variety of formats. These routines should be adequate for nearly
any task that involves temporal calculations or the maintenance
of data gathered over a long period of time.
All functions, global variables, and manifest constants used in
connection with time are defined and described in the header
files time.h and timeb.h.
The COHERENT system includes the following functions to manipu-
late time:
asctime Convert time structure to ASCII string
ctime Convert system time to an ASCII string
ftime Get the current time from the operating system
gmtime Convert system time to calendar structure
localtime Convert system time to calendar structure
settz Set local time zone
time Get current time
To print out the local time, a program must perform the following
tasks: First, read the system time with time. Then, it must pass
time's output to localtime, which breaks it down into the tm
structure. Next, it must pass localtime's output to asctime,
which transforms the tm structure into an ASCII string. Finally,
it must pass the output of asctime to printf, which displays it
on the standard output device. See the entry for asctime for an
example of such a program.
***** Example *****
For an example of time functions, see the entry for asctime.
***** See Also *****
Libraries
COHERENT Lexicon Page 1