Convert double value return by Outlook api to CTime

A

amit deshpande

hi ,
i have following code
_ContactItem contactItem;
COleException e;
OleInitialize (NULL);
_Application olApp;
MAPIFolder pFolder;
if (!olApp.CreateDispatch(_T("Outlook.Application"), &e))
{
CString strError;
strError.Format(_T("CreateDispatch() failed with error 0x%08lx"),
e.m_sc);
//AfxMessageBox(strError, MB_SETFOREGROUND);
OleUninitialize ();
return 0;
}
_NameSpace oNameSpace = olApp.GetNamespace(_T("MAPI"));
pFolder=oNameSpace.GetDefaultFolder(10);
_Items Items;
_Items pItems= pFolder.GetItems();
pContact = Items.GetFirst ();
long l = pContact.GetBirthday();//which i have to convert to long value
//function returns double value

i haven't understood the value that GetBirthDay() returns it is a
double value and it is very small value i.e 5 digits only.
so it can't be no of miliseconds or seconds from 1970's

so does anybody know how to convert this double value to Ctime
 
D

Dan Mitchell

amit deshpande said:
i haven't understood the value that GetBirthDay() returns it is a
double value and it is very small value i.e 5 digits only.
so it can't be no of miliseconds or seconds from 1970's

It's a DATE. (int part = days since midnight dec 1899, fractional part =
portion of the day); you can read this as COleDateTime if you want an
easier way to access it.

-- dan
 
A

amit deshpande

Dan said:
It's a DATE. (int part = days since midnight dec 1899, fractional part =
portion of the day); you can read this as COleDateTime if you want an
easier way to access it.

-- dan


thank u i have succeeded in doing it

thnax and regards
Amit Deshpande
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top