Next: Setting an Alarm, Previous: Processor And CPU Time, Up: Date and Time
This section describes facilities for keeping track of calendar time. See Time Basics.
The GNU C library represents calendar time three ways:
time_t
data type) is a compact
representation, typically giving the number of seconds of elapsed time
since some implementation-specific base time.
struct
timeval
data type, which includes fractions of a second. Use this time
representation instead of simple time when you need greater precision.
struct tm
data
type) represents a calendar time as a set of components specifying the
year, month, and so on in the Gregorian calendar, for a specific time
zone. This calendar time representation is usually used only to
communicate with people.