[DiscordArchive] hey guys, does anyone want to explain me how to work with datetime in c++?
[DiscordArchive] hey guys, does anyone want to explain me how to work with datetime in c++?
Archived author: MR.MUSTACHE • Posted: 2019-07-31T09:10:56.633000+00:00
Original source
hey guys, does anyone want to explain me how to work with datetime in c++?
Archived author: MR.MUSTACHE • Posted: 2019-07-31T09:13:33.025000+00:00
Original source
I explored the cs_misc.cpp, saw that trinitycore uses last_login as string
Archived author: MR.MUSTACHE • Posted: 2019-07-31T09:13:34.944000+00:00
Original source
lastLogin = fields[5].GetString();
Archived author: MR.MUSTACHE • Posted: 2019-07-31T09:13:52.241000+00:00
Original source
how can I use it as date?
Archived author: MR.MUSTACHE • Posted: 2019-07-31T09:14:21.525000+00:00
Original source
will this
https://www.tutorialspoint.com/cplusplus/cpp_date_time
be enough?
[Embed: C++ Date and Time]
C++ Date and Time - Learn C++ in simple and easy steps starting from basic to advanced concepts with examples including C++ Overview, Environment Setup, Basic Syntax, Comments, Data Types, Variable Types, Scope, Constants/Literals, Modifier Types, Storage Classes, Operators, ...
https://www.tutorialspoint.com/cplusplus/cpp_date_time
Archived author: MR.MUSTACHE • Posted: 2019-07-31T09:14:59.698000+00:00
Original source
cuz I want to make a compare between datetime from database and current datetime
Archived author: MR.MUSTACHE • Posted: 2019-07-31T09:23:36.734000+00:00
Original source
oh actually found similar code for daily quests time
Archived author: MR.MUSTACHE • Posted: 2019-07-31T09:23:40.769000+00:00
Original source
```cpp
void World::InitDailyQuestResetTime(bool loading)
{
time_t mostRecentQuestTime = 0;
if (loading)
{
QueryResult result = CharacterDatabase.Query("SELECT MAX(time) FROM character_queststatus_daily");
if (result)
{
Field* fields = result->Fetch();
mostRecentQuestTime = time_t(fields[0].GetUInt32());
}
}
```
Archived author: MR.MUSTACHE • Posted: 2019-07-31T09:23:46.985000+00:00
Original source
I believe this will do the trick
Archived author: MR.MUSTACHE • Posted: 2019-07-31T09:23:47.573000+00:00
Original source