mirror of
https://github.com/znc/znc.git
synced 2026-08-08 01:43:03 +02:00
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:
@@ -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