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
43 lines
1.4 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: Version.cpp
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Source file of Version.cpp
|
|
//----------------------------------------------------------------------------
|
|
|
|
#include "..\LgLib\Version.h"
|
|
|
|
struct tm CLgVersion::m_Time = {0,0,0,1,0,0,0,0};
|
|
char CLgVersion::m_pTime[256] = {'\0'};
|
|
|
|
CLgVersion::CLgVersion( char *pTime, char *pDate ){
|
|
|
|
|
|
const char *pMonth = "JanFebMarAprMayJunJulAugSepOctNovDec";
|
|
memset( &m_Time, 0, sizeof(struct tm) );
|
|
m_Time.tm_mday = 1;
|
|
|
|
m_pTime[0]=(char)0;
|
|
struct tm tNew;
|
|
memset( &tNew, 0, sizeof(tNew) );
|
|
char pM[256];
|
|
sscanf( pDate, _T("%3s %hu %hu"), pM, &tNew.tm_mday, &tNew.tm_year );
|
|
tNew.tm_mon = (int)( strstr( pMonth, pM ) - pMonth) / ( 3 * sizeof(char) );
|
|
sscanf( pTime, _T("%hu:%hu:%hu"), &tNew.tm_hour, &tNew.tm_min, &tNew.tm_sec );
|
|
tNew.tm_year -= 1900;
|
|
tNew.tm_wday = tNew.tm_yday = tNew.tm_isdst = -1;
|
|
//if( mktime( &tNew ) > mktime( &m_Time ) )
|
|
//{
|
|
memcpy( &m_Time, &tNew, sizeof(struct tm) );
|
|
//Old Format strftime( m_pTime, MAX_PATH, _T("%d/%m/%Y %H:%M:%S"), &tNew );
|
|
strftime( m_pTime, 256, _T("%y%m%d"), &tNew );
|
|
//}
|
|
}
|
|
|