Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Time Issue

Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
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.
 
Newbie Spellweaver
Joined
Dec 12, 2018
Messages
15
Reaction score
11
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