mirror of
https://github.com/znc/znc.git
synced 2026-08-03 23:43:42 +02:00
Use time zone string instead of offset.
This is done by setting the TZ variable prior to calling localtime() or ctime(). There are a few calls to ctime()/localtime() which doesn’t adjust for time zone offset. This patch affects the behavior of these since the TZ variable is global.
This commit is contained in:
+2
-2
@@ -62,8 +62,8 @@ void CLogMod::PutLog(const CString& sLine, const CString& sWindow /*= "Status"*/
|
||||
char buffer[1024];
|
||||
|
||||
time(&curtime);
|
||||
// Don't forget the user's timezone offset (which is in hours and we want seconds)
|
||||
curtime += (time_t) (m_pUser->GetTimezoneOffset() * 60 * 60);
|
||||
// Don't forget the user's timezone offset
|
||||
setenv("TZ", m_pUser->GetTimezone().c_str(), 1);
|
||||
timeinfo = localtime(&curtime);
|
||||
|
||||
// Generate file name
|
||||
|
||||
Reference in New Issue
Block a user