time
Go Up to time.h Index
Header File
time.h
Category
Time and Date Routines
Prototype
time_t time(time_t *timer);
Description
Gets time of day.
time gives the current time, in seconds, elapsed since 00:00:00 GMT, January 1, 1970, and stores that value in the location pointed to by timer, provided that timer is not a NULL pointer.
Return Value
time returns the elapsed time in seconds.
Example
#include <time.h> #include <stdio.h> int main(void) { time_t t; t = time(NULL); printf("The number of seconds since January 1, 1970 is %ld",t); return 0; }
Portability
POSIX | Win32 | ANSI C | ANSI C++ |
---|---|---|---|
+ |
+ |
+ |
+ |