Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.0 KiB

  1. #ifdef _DEBUG
  2. #define new DEBUG_NEW
  3. #endif
  4. //////////////////////////////////////////////////////////////////////
  5. // Time Members
  6. //////////////////////////////////////////////////////////////////////
  7. inline CString CStatistics::GetStatLocalTime()
  8. {
  9. CString sTime;
  10. CString sDate;
  11. CString sDateTime;
  12. int iLen = GetTimeFormat(LOCALE_USER_DEFAULT,0L,&m_st,NULL,NULL,0);
  13. iLen = GetTimeFormat(LOCALE_USER_DEFAULT,0L,&m_st,NULL,sTime.GetBuffer(iLen+(sizeof(TCHAR)*1)),iLen);
  14. sTime.ReleaseBuffer();
  15. iLen = GetDateFormat(LOCALE_USER_DEFAULT,0L,&m_st,NULL,NULL,0);
  16. iLen = GetDateFormat(LOCALE_USER_DEFAULT,0L,&m_st,NULL,sDate.GetBuffer(iLen+(sizeof(TCHAR)*1)),iLen);
  17. sDate.ReleaseBuffer();
  18. sDateTime = sDate + _T(" ") + sTime;
  19. return sDateTime;
  20. }
  21. //////////////////////////////////////////////////////////////////////
  22. // Comparison
  23. //////////////////////////////////////////////////////////////////////
  24. inline int CStatistics::CompareTo(CStatistics* pStat)
  25. {
  26. CTime time1 = m_st;
  27. CTime time2 = pStat->m_st;
  28. return time1 == time2;
  29. }