From b5bea6ef18bd33fbb424ae9f909c119496463d02 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 21 Oct 2012 20:02:42 +0000 Subject: fixed birthdate git-svn-id: http://svn.miranda-ng.org/main/trunk@2037 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_contacts.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'protocols/Skype') diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index 4bbd143566..6e29158e95 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -70,15 +70,15 @@ void CSkypeProto::UpdateContactBirthday(HANDLE hContact, CContact::Ref contact) { uint data; contact->GetPropBirthday(data); - if (data > 0) + TCHAR date[9]; + _itot_s(data, date, 10); + if (date > 0) { - struct tm* ptm; - time_t timeGMT = (time_t)data; - ptm = gmtime(&timeGMT); - this->SetSettingByte(hContact, "BirthDay", ptm->tm_mday); - this->SetSettingByte(hContact, "BirthMonth", ptm->tm_mon); - // todo: fix stupid year constant - this->SetSettingWord(hContact, "BirthYear", ptm->tm_year + 1917); + INT day, month, year; + _stscanf(date, _T("%04d%02d%02d"), &year, &month, &day); + this->SetSettingByte(hContact, "BirthDay", day); + this->SetSettingByte(hContact, "BirthMonth", month); + this->SetSettingWord(hContact, "BirthYear", year); } else { -- cgit v1.2.3