localtime 转换时间

	struct tm * stm = NULL;
	long ltime = atol("1290140656");
	stm = localtime(&ltime);
	printf("Local hour is: %d-%d-%d %d:%d:%d\n",stm->tm_year+1900,stm->tm_mon+1,stm->tm_mday,
												stm->tm_hour,stm->tm_min,stm->tm_sec);
	

 

 Local hour is: 2010-10-19 2:7:35

你可能感兴趣的:(local)