Time Issue

Joined
Mar 26, 2012
Messages
1,459
Reaction score
130
I have been fighting this for better part of a day when I believe it should be super simple.
Using: Windows 10, Server 2012, SQL Server 2012, Visual Studio 2017(C++)
Database Value = 201812290000//YYYYMMDDHHMM

This is the current code but, it isn't correct.
char strEnd_Time[13] = {0,};
qry->GetStr("BlockTime", strEnd_Time );
CTime tEnd_Time;

GetStrTime(&tEnd_Time, strEnd_Time);

CTime NowTime = CTime::GetCurrentTime();
if( NowTime > tEnd_Time )
{
nBlock = 1;
}
What I need?
I need it to read from the database and compare to the current time of the server. The current system is based in (YYYYMMDD) and completely retarded. I want it to include hours and minutes.

Any help with this issue would be greatly appreciated at this time as I don't know what the heck I am doing.

Thank you.
 
Can't you get the UNIX timestamp from DB ? Then you can turn it to whatever YYYY/MM/DD HH:MM:SS
 
Querying the database is slow, also doing that will slow the application performance, it is easier to use an API or Syscall then using some workarounds.
 
Back