Facebook Page Twitter Page LinkedIn Page
× C Standard Library

The C <time.h> header defines several functions, types and macros to get and manipulate date and time information. These types and macros are available to use in a current program after including the header file using - #include <time.h>. All types and macros of this header file are listed below:

Library Functions

Time manipulation functions

clock() Returns raw processor clock time since the program is started.
difftime() Returns difference between two times.
time() Returns the current time.

Format conversion functions

asctime() Converts tm structure to a textual representation.
ctime() Convert time_t value to a textual representation.
gmtime() Convert time_t value into calendar time, expressed in UTC time.
localtime() Convert time_t value into calendar time, expressed in local time.

Library Types

clock_t Process running time.
size_t Unsigned integer type.
time_t Time type.
tm Time structure.

Library Macros

Macro constants

CLOCKS_PER_SEC Number of processor clock ticks per second.
NULL Null pointer.