This section describes facilities for keeping track of dates and times according to the Gregorian calendar.
There are three representations for date and time information:
Calendar time (the time_t
data type) is a compact representation, typically giving the number of seconds elapsed since some implementation-specific base time.
There is also a high-resolution time representation (the struct timeval
data type) that includes fractions of a second. Use this time representation instead of ordinary calendar time when you need greater precision.
Local time or broken-down time (the struct tm
data type) represents the date and time as a set of components specifying the year, month, and so on, for a specific time zone. This time representation is usually used in conjunction with formatting date and time values.
Simple Calendar Time | Facilities for manipulating calendar time. |
High-Resolution Calendar | A time representation with greater precision. |
Broken-down Time | Facilities for manipulating local time. |
Formatting Date and Time | Converting times to strings. |
TZ Variable | How users specify the time zone. |
Time Zone Functions | Functions to examine or specify the time zone. |
Time Functions Example | An example program showing use of some of the time functions. |