time_t time(time_t *timer)
time取得以秒为单位从1970年1月1日各林威治时间00:00:00算起的当前时间,并将起存入由timer所指定位置中,timer不能为空指针。
#include <time.h>
#include <stdio.h>
#include <dos.h>
int main(void)
{
time_t t;
t=time(NULL);
printf("The number of seconds since January 1,1970 is %ld",t);
return 0;
}