G
Guest
This question continues on from a previous post "DATE to string" but I think
it deserves a new thread.
In my previous post I was trying to convert a DATE to string in a NON MFC
C++ application which (with a little help) was achieved with the following
code:
******************
// Variables
DATE MailDateTime;
LPSYSTEMTIME SysTime;
string FormattedDateTime;
std:stringstream oss_date;
//Get mail received time from outlook to DATE
MailDateTime = spMailItem->GetReceivedTime();
//Convert DATE to LPSYSTEMTIME
VariantTimeToSystemTime(MailDateTime, SysTime);
//Build string stream from date parts for readable format day/month/year
oss_date << SysTime->wDay << "/" << SysTime->wMonth << "/" << SysTime->wYear;
//assign string stream to string
FormattedDateTime.assign(oss_date.str());
*******************
I now need to go the other way which again I am having trouble with..
Firstly I need to get a string containing a formatted date time (e.g
"25/10/2006 10:15:00") into a LPSYSTEMTIME and then convert to a DATE type
using SystemTimeToVariantTime.
The main issue I am having at the mo is the conversion from string to
LPSYSTEMTIME.
Can anyone help with this?
Thanks again...
it deserves a new thread.
In my previous post I was trying to convert a DATE to string in a NON MFC
C++ application which (with a little help) was achieved with the following
code:
******************
// Variables
DATE MailDateTime;
LPSYSTEMTIME SysTime;
string FormattedDateTime;
std:stringstream oss_date;
//Get mail received time from outlook to DATE
MailDateTime = spMailItem->GetReceivedTime();
//Convert DATE to LPSYSTEMTIME
VariantTimeToSystemTime(MailDateTime, SysTime);
//Build string stream from date parts for readable format day/month/year
oss_date << SysTime->wDay << "/" << SysTime->wMonth << "/" << SysTime->wYear;
//assign string stream to string
FormattedDateTime.assign(oss_date.str());
*******************
I now need to go the other way which again I am having trouble with..
Firstly I need to get a string containing a formatted date time (e.g
"25/10/2006 10:15:00") into a LPSYSTEMTIME and then convert to a DATE type
using SystemTimeToVariantTime.
The main issue I am having at the mo is the conversion from string to
LPSYSTEMTIME.
Can anyone help with this?
Thanks again...