I got the Date value from the method from the following code
DATE dDate;
hr = pADsUser->get_PasswordLastChanged(&dDate);
// pADsUser is pointer variable of IADsUser
Date type is discribed in the link
http://msdn.microsoft.com/en-us/library/82ab7w69%28v=vs.71%29.aspx
How can I convert this kind of Date to string so that I can print it in console.
I am not using MFC Dlls for this application. so I cannot use the COleDateTime type also.
Is there any built in method available or Do I need to calculate the date manually?
Look into Boost.Lexical_cast for conversion to and from string.
You will have to write a converter function that unpacks the DATE type into a (date, time) tuple so that lexical_cast won’t convert from double.
According to the doc, it looks like the date type is (day – 1899-12-30) . (time – 0).
Using boost::date_time, you can create a time object with date-time (1899-12-30,0), then increment
days(abs(DATE))andhours((DATE - abs(DATE)) * 24).