This function returns the number of seconds since January 1, 1970.
#include <stdio.h>
#include <time.h>
int main () {
time_t Now;
Now = time (NULL);
printf ("The current time, in seconds since January 1, 1970, is %i.\n",
Now);
Now = time (&Now);
printf ("The current time, in seconds since January 1, 1970, is %i.\n",
Now);
time (&Now);
printf ("The current time, in seconds since January 1, 1970, is %i.\n",
Now);
return 0;
}
The current time, in seconds since January 1, 1970, is 1194673903. The current time, in seconds since January 1, 1970, is 1194673903. The current time, in seconds since January 1, 1970, is 1194673903.
Copyright © 1999-, jhyoung,
revised 00/00/0