获取系统时间

int get_sys_time(char * timeinfo_p)
{

	time_t rawtime;
	time(&rawtime);
	struct tm timeinfo;
	memcpy(&timeinfo,localtime(&rawtime),sizeof(struct tm));
	sprintf(timeinfo_p, "%d-%02d-%02dT%02d:%02d:%02d\+08:00",1900+timeinfo.tm_year,timeinfo.tm_mon+1,
					timeinfo.tm_mday,timeinfo.tm_hour,
					timeinfo.tm_min,timeinfo.tm_sec);
	
}


你可能感兴趣的:(获取系统时间)