#include <stdio.h>
#include <time.h>
/*************************
*name:localtime.c
*author:QG
*time:2015-05-13
*description:
**************************/
int main()
{
struct tm *c_tm;
time_t c_time;
c_time = time(NULL);
c_tm = localtime(&c_time);
printf("hour : %d min :%d second :%d!\n",c_tm->tm_hour,c_tm->tm_min,c_tm->tm_sec);
return 0;
}
时间编程 --localtime(获取本地时间)
最新推荐文章于 2024-08-18 08:52:27 发布