mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
feat(Core/Common): add new helpers for time utility (#10207)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "Errors.h"
|
||||
#include "Log.h"
|
||||
#include "MessageBuffer.h"
|
||||
#include "Timer.h"
|
||||
#include "Util.h"
|
||||
#include <ctime>
|
||||
#include <sstream>
|
||||
@@ -136,8 +137,7 @@ void ByteBuffer::append(uint8 const* src, size_t cnt)
|
||||
|
||||
void ByteBuffer::AppendPackedTime(time_t time)
|
||||
{
|
||||
tm lt;
|
||||
localtime_r(&time, <);
|
||||
tm lt = Acore::Time::TimeBreakdown(time);
|
||||
append<uint32>((lt.tm_year - 100) << 24 | lt.tm_mon << 20 | (lt.tm_mday - 1) << 14 | lt.tm_wday << 11 | lt.tm_hour << 6 | lt.tm_min);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user