Runtime-Support
Functions
-
Header
Files
6.1.10
Time
Functions
(time.h)
6-8
The
time.
h header declares one macro, several types, and functions that
manipulate dates and time. The functions deal
with
several types
of
time:
•
Calendar
time
represents the current date (according
to
the Gregorian
calendar) and time.
•
Local
time
is
the calendar time expressed for a specific time zone.
•
Daylight
savings
time
is a variation
of
local time.
The
time.
h header declares one macro,
CLK-TCK,
which
is the number per
second
of
the value returned by the clock function.
The header declares three types:
•
clock-t,
an
arithmetic type that represents time,
•
time-t,
an
arithmetic type that represents time,
and
• struct tm . is a structure that holds the components
of
calendar time,
called
broken-down time. The structure
has
the
following
members:
int
tm-sec;
/*
seconds
after
the
minute
(0-59)
*/
int
tm-min;
/*
minutes
after
the
hour
(0-59)
*/
int
tm-hour;
/*
hours
after
midnight
(0-23)
*/
int
tm-mday;
/*
day
of
the
month
(1-31)
*/
int
tm-mon;
/*
months
since
January
(0-11)
*/
int
tm-year;
/*
years
since
1900
(0-99)
*/
int
tm-wday;
/*
days
since
Saturday
(0-6)
*/
int
tm-ydaYi
/*
days
since
January
1
(0-365)
*/
int
tm-isdsti
/*
Daylight
Savings
Time
flag
-
*/
tm-isdst
can have one
of
three values:
A
positive value
if
Daylight Savings Time
is
in effect.
Zero
if
Daylight Savings Time
is
not
in effect.
A
negative value
if
the information is
not
available.
All
of
the time functions depend on the clockO and timeO functions,
which
you must customize for your system.