Merge branch 'master' of github.com:znc/znc

This commit is contained in:
Alexey Sokolov
2017-12-13 08:30:27 +00:00
9 changed files with 134 additions and 10 deletions
+2 -2
View File
@@ -58,8 +58,8 @@ class CAwayJob : public CTimer {
class CAway : public CModule {
void AwayCommand(const CString& sCommand) {
CString sReason;
time_t curtime;
time(&curtime);
timeval curtime;
gettimeofday(&curtime, nullptr);
if (sCommand.Token(1) != "-quiet") {
sReason = CUtils::FormatTime(curtime, sCommand.Token(1, true),
+4 -2
View File
@@ -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.%f",
GetUser()->GetTimezone());
}
+2 -2
View File
@@ -271,9 +271,9 @@ void CLogMod::PutLog(const CString& sLine,
}
CString sPath;
time_t curtime;
timeval curtime;
time(&curtime);
gettimeofday(&curtime, nullptr);
// Generate file name
sPath = CUtils::FormatTime(curtime, m_sLogPath, GetUser()->GetTimezone());
if (sPath.empty()) {