获取系统时间

SYSTEMTIME localtime;
GetLocalTime(&localtime);
char szTime[256] = {0};
sprintf_s(szTime, 256-1, "[%04d-%02d-%02d %02d:%02d:%02d :]", localtime.wYear, localtime.wMonth, localtime.wDay, localtime.wHour, localtime.wMinute, localtime.wSecond);

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