//获取本地时间
void CNQLog::GetLongTime(TCHAR* sLongTime)
{
TCHAR lastDate[30];
TCHAR lastTime[30];
SYSTEMTIME getTime;
GetLocalTime(&getTime);
GetTimeFormat(LOCALE_SYSTEM_DEFAULT, TIME_FORCE24HOURFORMAT,
&getTime, TEXT("hh':'mm':'ss"), lastTime, 30);
GetDateFormat(LOCALE_SYSTEM_DEFAULT, DATE_USE_ALT_CALENDAR, &getTime,
TEXT("yyyy'-'MM'-'dd"), lastDate, 30);
wsprintf(sLongTime, TEXT("%s %s"), lastDate, lastTime);
}
void CNQLog::GetLongTime(TCHAR* sLongTime)
{
TCHAR lastDate[30];
TCHAR lastTime[30];
SYSTEMTIME getTime;
GetLocalTime(&getTime);
GetTimeFormat(LOCALE_SYSTEM_DEFAULT, TIME_FORCE24HOURFORMAT,
&getTime, TEXT("hh':'mm':'ss"), lastTime, 30);
GetDateFormat(LOCALE_SYSTEM_DEFAULT, DATE_USE_ALT_CALENDAR, &getTime,
TEXT("yyyy'-'MM'-'dd"), lastDate, 30);
wsprintf(sLongTime, TEXT("%s %s"), lastDate, lastTime);
}