_tcslen=lstrlen: the number of TCHARs
strlen = lstrlenA:the bytes of string
wcslen = lstrlenW: 字符串的字符个数
_T("123设计模式") = _TEXT("123设计模式") TCHAR格式
L"123设计模式" WCHAR格式
"123设计模式" CHAR格式
怎样获取当前时间?
A:精确到毫秒
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME;
SYSTEMTIME tm;
GetSystemTime(&tm); 格林威志标准时间
GetLocalTime(&tm); 返回所在地区的时间,北京时间
B:精确到秒
CTime tm = CTime::GetCurrentTime();//精确到秒
tm.Format("%Y年%m月%d日 %H点%M分%S秒")
C:精确到55毫秒
DWORD GetTickCount() = DWORD GetCurrentTime() //系统运行的时间 精确到55毫秒
D:精确到秒
time_t time();//从1970开始来的秒数
转换:VariantTimeToSystemTime(DATE param1, &SYSTEMTIME param2)//DATE(double)->SYSTEMTIME