Skip to content
C time.h
Functions
Time Manipulation Functions
- clock()
- Returns the processor time consumed by the program since it started execution, measured in clock ticks.
- difftime()
- Computes the difference in seconds between two time values of type
time_t.
- mktime()
- Converts a
tm structure representing local time into a time_t value.
- time()
- Returns the current calendar time as a
time_t value, representing seconds since the epoch (January 1, 1970).
Conversion Functions
- asctime()
- Converts a
tm structure into a human-readable string representing the date and time in the format Www Mmm dd hh:mm:ss yyyy.
- ctime()
- Converts a
time_t value into a string representing the local time in the format Www Mmm dd hh:mm:ss yyyy.
- gmtime()
- Converts a
time_t value into a tm structure representing Coordinated Universal Time (UTC).
- localtime()
- Converts a
time_t value into a tm structure representing local time, adjusted for the system’s time zone.
- strftime()
- Formats a
tm structure into a string according to a specified format, allowing customization of date and time representation.