时间函数举例1
include
include
int main ()
{
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
printf ( "当前本地时间为: %s", asctime (timeinfo) );
return 0;
}
以上实例运行输出结果为:
当前本地时间为: Tue Nov 10 16:28:49 2015
时间函数举例1
int main ()
{
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
printf ( "当前本地时间为: %s", asctime (timeinfo) );
return 0;
}
以上实例运行输出结果为:
当前本地时间为: Tue Nov 10 16:28:49 2015