Use and propagate microsecond-precision timestamps to FormatTime
This enables sub-second precision timestamp formatting for logs and clients without server-time.
This commit is contained in:
6 files changed
+21
-10
No files matched your search
@@ -154,8 +154,10 @@ class CListSockets : public CModule {
|
||||
|
||||
CString GetCreatedTime(Csock* pSocket) {
|
||||
unsigned long long iStartTime = pSocket->GetStartTime();
|
||||
time_t iTime = iStartTime / 1000;
|
||||
return CUtils::FormatTime(iTime, "%Y-%m-%d %H:%M:%S",
|
||||
timeval tv;
|
||||
tv.tv_sec = iStartTime / 1000;
|
||||
tv.tv_usec = iStartTime % 1000 * 1000;
|
||||
return CUtils::FormatTime(tv, "%Y-%m-%d %H:%M:%S.%L",
|
||||
GetUser()->GetTimezone());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user