Old fashion design for PC-104
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.2 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: Version.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of Version.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "..\LgLib\Version.h"
  16. struct tm CLgVersion::m_Time = {0,0,0,1,0,0,0,0};
  17. TCHAR CLgVersion::m_pTime[MAX_PATH] = "";
  18. CLgVersion::CLgVersion( LPCTSTR pTime, LPCTSTR pDate )
  19. {
  20. LPCTSTR pMonth = "JanFebMarAprMayJunJulAugSepOctNovDec";
  21. struct tm tNew;
  22. memset( &tNew, 0, sizeof(tNew) );
  23. TCHAR pM[MAX_PATH];
  24. sscanf( pDate, _T("%3s %hu %hu"), pM, &tNew.tm_mday, &tNew.tm_year );
  25. tNew.tm_mon = (INT)(strstr( pMonth, pM ) - pMonth) / 3;
  26. sscanf( pTime, _T("%hu:%hu:%hu"), &tNew.tm_hour, &tNew.tm_min, &tNew.tm_sec );
  27. tNew.tm_year -= 1900;
  28. tNew.tm_wday = tNew.tm_yday = tNew.tm_isdst = -1;
  29. if( mktime( &tNew ) > mktime( &m_Time ) )
  30. {
  31. m_Time = tNew;
  32. strftime( m_pTime, MAX_PATH, _T("%d/%m/%Y %H:%M:%S"), &tNew );
  33. }
  34. }