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:
Allan Odgaard
2011-10-09 16:51:19 +02:00
parent b8247095d1
commit eca0211bb8
4 changed files with 7 additions and 8 deletions
+2 -2
View File
@@ -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