CString convert in Date

Hello Guys ,
I have a CString and it is like [CPLM]......27.12.1999 and I would like to convert date in this String in a DAte form, because I need 27.12.1999 for some calcutaions.
I have just CString inf="23.10.1983";
COleDateTime t; //Test
t.ParseDateTime(inf);
but it did not worked.

If you could help me , I will be very happy
thx,
You're going to have to show more code than that. Post the class definition...
closed account (j3bk4iN6)
in python they have an eval() function that evaluates the string and converts it to integer, is there something similiar in C++
atoi, but it's non-standard (in C++). I think you can use stringstreams for that.
POSIX defines strptime() to parse date and time.
The Problem ist , I have a string ([CPLM]......27.12.1999), and I want to get 27.12.1999 from this string and I want to convert this 27.12.1999 in data format.
that is the question actually and the for string I used CString ..I am working with MFC

Thank you for your help
first use STL algorithm methods like rfind, find, compare...

after that you should get the date like 27121999

then store it in an array, int date[9]; //date[0] = 2, date[1] = 7;

or you can also use modulo

day = 27121999 - 27121999%1000000; for the day.
month = 27121999 - (day*1000000) - 27121999%10000;
year = 27121999%10000;

or simply

date = 27121999;
day = date - date%1000000;
year = date%10000;
month = date - (day*1000000 + year);

use atoi to convert it to int as suggested by chrisname...
Topic archived. No new replies allowed.