diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2014-08-31 14:14:07 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2014-08-31 14:14:07 +0000 |
commit | b35a3607236bcd628d56290fe4a72977454ac1c7 (patch) | |
tree | f01ed7285eab4be49517e205d54789dc10c255a5 | |
parent | 27886af6334d2abd8315bee87aaa4314b91957c4 (diff) |
Fixed UTC conversion
git-svn-id: http://svn.miranda-ng.org/main/trunk@10346 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/WhatsApp/src/contacts.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index 533f8c32ba..59c32ed746 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -276,16 +276,9 @@ void WhatsAppProto::UpdateStatusMsg(MCONTACT hContact) if (lastSeen != -1)
{
time_t timestamp = time(NULL) - lastSeen;
-
- FILETIME ft;
- UnixTimeToFileTime(timestamp, &ft);
- SYSTEMTIME st;
- FileTimeToSystemTime(&ft, &st);
-
- TCHAR stzDate[MAX_PATH], stzTime[MAX_PATH];
- GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st,0, stzTime, SIZEOF(stzTime));
- GetDateFormat(LOCALE_USER_DEFAULT, 0, &st,0, stzDate, SIZEOF(stzDate));
- ss << TranslateT("Last seen on ") << stzDate << TranslateT(" at ") << stzTime;
+ TCHAR stzLastSeen[MAX_PATH];
+ _tcsftime(stzLastSeen,SIZEOF(stzLastSeen),TranslateT("Last seen on %x at %X"),localtime(×tamp));
+ ss << stzLastSeen;
}
int state = getDword(hContact, WHATSAPP_KEY_LAST_MSG_STATE, 2);
|