C Programming/time.h/time t

The time_t datatype is a data type in the ISO C library defined for storing system time values. Such values are returned from the standard  library function. This type is a typedef defined in the standard &lt;time.h&gt; header. ISO C defines time_t as an arithmetic type, but does not specify any particular type, range, resolution, or encoding for it. Also unspecified are the meanings of arithmetic operations applied to time values.

Implementation
Unix and POSIX-compliant systems implement time_t as an integer or real-floating type (typically a 32- or 64-bit integer) which represents the number of seconds since the start of the Unix epoch: midnight UTC of January 1, 1970 (not counting leap seconds). Some systems correctly handle negative time values, while others do not. Systems using a signed 32-bit  type are susceptible to the Year 2038 problem.

In addition to the time function, ISO C also specifies other functions and types for converting time_t system time values into calendar times and vice versa.

Example
The following C code retrieves the current time, formats it as a string, and writes it to the standard output.

Conversion to civil time
Using GNU date, a given  value can be converted into its equivalent calendar date:

$ date -ud@1234567890 Fri Feb 13 23:31:30 UTC 2009

Similarly, using BSD date:

$ date -ur 1234567890 Fri Feb 13 23:31:30 UTC 2009