GetSystemTime

//
//SYSTEMTIME 
//GetSystemTime
//

void GetSysTime(char* &lpTimeMsg)
{
	//get system time
	SYSTEMTIME systemTime;
	memset((void*)&systemTime,0,sizeof(SYSTEMTIME));
	GetSystemTime(&systemTime);
	char lpSystemTime[256] = "\0";
	sprintf(lpSystemTime,"[ %4d.%2d.%2d  %2d:%2d:%2d ]",systemTime.wYear,\
		systemTime.wMonth,systemTime.wDay,systemTime.wHour+8,\
		systemTime.wMinute,systemTime.wSecond);

	char lpMsg[512] = "\0";
	strcpy(lpMsg,lpSystemTime);
	strcat(lpTimeMsg,lpMsg);
	strcat(lpTimeMsg,"\n");
}

你可能感兴趣的:(GetSystemTime)