For DOS Protected Mode version of sensor core software
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.

43 lines
1.4 KiB

3 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 "..\LgLib\Version.h"
  15. struct tm CLgVersion::m_Time = {0,0,0,1,0,0,0,0};
  16. char CLgVersion::m_pTime[256] = {'\0'};
  17. CLgVersion::CLgVersion( char *pTime, char *pDate ){
  18. const char *pMonth = "JanFebMarAprMayJunJulAugSepOctNovDec";
  19. memset( &m_Time, 0, sizeof(struct tm) );
  20. m_Time.tm_mday = 1;
  21. m_pTime[0]=(char)0;
  22. struct tm tNew;
  23. memset( &tNew, 0, sizeof(tNew) );
  24. char pM[256];
  25. sscanf( pDate, _T("%3s %hu %hu"), pM, &tNew.tm_mday, &tNew.tm_year );
  26. tNew.tm_mon = (int)( strstr( pMonth, pM ) - pMonth) / ( 3 * sizeof(char) );
  27. sscanf( pTime, _T("%hu:%hu:%hu"), &tNew.tm_hour, &tNew.tm_min, &tNew.tm_sec );
  28. tNew.tm_year -= 1900;
  29. tNew.tm_wday = tNew.tm_yday = tNew.tm_isdst = -1;
  30. //if( mktime( &tNew ) > mktime( &m_Time ) )
  31. //{
  32. memcpy( &m_Time, &tNew, sizeof(struct tm) );
  33. //Old Format strftime( m_pTime, MAX_PATH, _T("%d/%m/%Y %H:%M:%S"), &tNew );
  34. strftime( m_pTime, 256, _T("%y%m%d"), &tNew );
  35. //}
  36. }