mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01: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:
@@ -189,7 +189,7 @@ private:
|
||||
sReason = SIMPLE_AWAY_DEFAULT_REASON;
|
||||
|
||||
time_t iTime = time(NULL);
|
||||
iTime += (time_t)(m_pUser->GetTimezoneOffset() * 60 * 60); // offset is in hours
|
||||
setenv("TZ", m_pUser->GetTimezone().c_str(), 1);
|
||||
CString sTime = ctime(&iTime);
|
||||
sTime.Trim();
|
||||
sReason.Replace("%s", sTime);
|
||||
|
||||
Reference in New Issue
Block a user