Click to See Complete Forum and Search --> : Date Formating form the Custom String


rm_kapadia
July 20th, 2005, 07:55 AM
Hi.. All
I m Working on one of Text -correction module ..
I have some difficulty in conversion of the various form of Date come in to raw-input text to some Standard format(mmmm dd yyyy).

various possibilty of Date text are:
input OutPut
Jan 5th 2005 = January 5, 2005
Jan 2605 = January 26, 2005
Jan of 05 = January 2005
Jan 05 = January 2005
6th of June = June 6, 2005 or June 6
6th of June 05= June 6, 2005
this month 6th = July 6, 2005
On 6th of this month = June 6, 2005

or monly number like max-digit(i.e: 06242005) = output Reqired is : mm/dd/yyyy =06/24/2005
to min-digit (i.e : 625) = = output Reqired is : mm/dd/yyyy =06/2/2005


Can any one Guide me ... how I can Do...it..
I m very much confused ?? for the logic....
can any MFC class help here ? CDateTime , CDateTimeFormatInfo ????

pls...Help me ... looking for positive reply form all of u !

thanks in Advance !!

Rajan Kapadia

amgturk
July 21st, 2005, 06:08 AM
hi
I am not sure it will help you but you can have a look to MSDN about
COleDateTime::Format

maybe you will have an idea...

also an example exists

COleDateTime t(1999, 3, 19, 22, 15, 0);

CString str = t.Format(_T("%A, %B %d, %Y"));
ASSERT(str == _T("Friday, March 19, 1999"));

Qwick1E
July 26th, 2005, 12:26 AM
In Manage C++ you use the DateTime function.