| Functions | ||||
| Time manipulation | ||||
time | ||||
(C11) | ||||
(C23) | ||||
| Format conversions | ||||
(deprecated in C23)(C11) | ||||
(deprecated in C23)(C11) | ||||
(C95) | ||||
(C23)(C11) | ||||
(C23)(C11) | ||||
| Constants | ||||
| Types | ||||
(C11) |
Defined in header <time.h> | ||
Returns the current calendar time encoded as atime_t object, and also stores it in thetime_t object pointed to byarg (unlessarg is a null pointer)
Contents |
| arg | - | pointer to atime_t object where the time will be stored, or a null pointer |
Current calendar time encoded astime_t object on success,(time_t)(-1) on error. Ifarg is not a null pointer, the return value is also stored in the object pointed to byarg.
The encoding of calendar time intime_t is unspecified, but most systems conform toPOSIX specification and return a value of integral type holding the number of seconds sincethe Epoch. Implementations in whichtime_t is a 32-bit signed integer (many historical implementations) fail in the year2038.
Possible output:
The current time is Fri Apr 24 15:05:25 2015(1429887925 seconds since the Epoch)
(C23)(C11) | converts time since epoch to calendar time expressed as local time (function)[edit] |
(C23)(C11) | converts time since epoch to calendar time expressed as Coordinated Universal Time (UTC) (function)[edit] |
(C11) | returns the calendar time in seconds and nanoseconds based on a given time base (function)[edit] |
C++ documentation fortime | |