//测试用例
{
SYSTEMTIME tmLocal;
LONGLONG iUnixTimeStamp = 100000000i64;
double fZoneHours = +8;
//转换成系统时间
ConvUnixTimestamp2SystemTime(iUnixTimeStamp, fZoneHours, tmLocal);
TRACE(_T("%I64d = %04d-%02d-%02d %02d:%02d:%02d [Week%d][Zone=%+.*g]\n"),
iUnixTimeStamp,
tmLocal.wYear, tmLocal.wMonth, tmLocal.wDay,
tmLocal.wHour, tmLocal.wMinute, tmLocal.wSecond,
tmLocal.wDayOfWeek,
5, fZoneHours);
//系统时间转换成Unix Timestamp
LONGLONG iUnixTimeStampO = ConvSystemTime2UnixTimestamp(tmLocal, fZoneHours);
ASSERT(iUnixTimeStamp == iUnixTimeStampO);
}
//测试输出
-100000000 = 1966-10-31 22:13:20 [Week1][Zone=+8] |