• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Time Issue

Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
131
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.
 
Newbie Spellweaver
Joined
Dec 12, 2018
Messages
15
Reaction score
12
Can't you get the UNIX timestamp from DB ? Then you can turn it to whatever YYYY/MM/DD HH:MM:SS
 
Junior Spellweaver
Joined
Oct 27, 2008
Messages
165
Reaction score
89
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
Top