函数原型:time_t time(time_t *timer)
函数功能:得到系统当前时间
函数返回:系统当前时间
参数说明:timer=NULL时得到机器日历时间,timer为有效指针时,更新timer为系统当前时间
time_t是一个long类型
#include <time.h>
#include <stdio.h>
#include <dos.h>
int main()
{
time_t t;
t=time(NULL);
printf("The number of seconds since January 1,1970 is %ld\n",t);
return 0;
}