RT,因为要做一个手机通讯录和服务器之间同步的程序,需要得知通讯录条目修改的时间。有没有呢,如果没有的话要如何得知该条目的修改时间好呢
------解决方案--------------------------------------------------------
CContactDatabase* iContacts = CContactDatabase::OpenL();
CleanupStack::PushL(iContacts);
TContactIter iter(*iContacts);
TContactItemId cardId;
TBuf<100> tTime;
while (((cardId = iter.NextL()) != KNullContactId))
{
TTime time;
CContactItem* card = iContacts->ReadContactL(cardId);
if (card != NULL)
time = card->LastModified(); ////////你要的东西
else
continue;
RTz tzServer;
User::LeaveIfError(tzServer.Connect());
CleanupClosePushL(tzServer);
CTzConverter* tzConverter = CTzConverter::NewL(tzServer);
CleanupStack::PushL(tzConverter);
tzConverter->ConvertToLocalTime(time);
CleanupStack::PopAndDestroy(2);
}
CleanupStack::PopAndDestroy(iContacts);