How to Compare two Dates
-
hi all, i am having a two DateTimePicker Control, i have selected Two Dates from that and put in a EditBox how to compare the Dates from the EditBox. Is this Possible with COleDateTime, if possible then please provide a snippet of Code. thanks, uday. uday kiran
-
hi all, i am having a two DateTimePicker Control, i have selected Two Dates from that and put in a EditBox how to compare the Dates from the EditBox. Is this Possible with COleDateTime, if possible then please provide a snippet of Code. thanks, uday. uday kiran
You can see this link: http://www.codeproject.com/datetime/datetimecompare.asp[^] Vision is Always important and so is your ATTITUDE. Wishes. Anshuman Dandekar
-
hi all, i am having a two DateTimePicker Control, i have selected Two Dates from that and put in a EditBox how to compare the Dates from the EditBox. Is this Possible with COleDateTime, if possible then please provide a snippet of Code. thanks, uday. uday kiran
kiran janaswamy wrote:
how to compare the Dates from the EditBox. Is this Possible with COleDateTime
Yes.
kiran janaswamy wrote:
if possible then please provide a snippet of Code
COleDateTime dateOne(95, 3, 15, 12, 0, 0); // 15 March 1995 12 noon
COleDateTime dateTwo(dateOne); // 15 March 1995 12 noon
BOOL b;
b = dateOne == dateTwo; // TRUEdateTwo.SetStatus(COleDateTime::invalid);
b = dateOne == dateTwo; // FALSE, different status
b = dateOne != dateTwo; // TRUE, different status
b = dateOne < dateTwo; // FALSE, same value
b = dateOne > dateTwo; // FALSE, same value
b = dateOne <= dateTwo; // TRUE, same value
b = dateOne >= dateTwo; // TRUE, same valueAnd how to convert a string to COleDateTime object?? Use
ParseDateTime
.
Nibu thomas Software Developer
-
kiran janaswamy wrote:
how to compare the Dates from the EditBox. Is this Possible with COleDateTime
Yes.
kiran janaswamy wrote:
if possible then please provide a snippet of Code
COleDateTime dateOne(95, 3, 15, 12, 0, 0); // 15 March 1995 12 noon
COleDateTime dateTwo(dateOne); // 15 March 1995 12 noon
BOOL b;
b = dateOne == dateTwo; // TRUEdateTwo.SetStatus(COleDateTime::invalid);
b = dateOne == dateTwo; // FALSE, different status
b = dateOne != dateTwo; // TRUE, different status
b = dateOne < dateTwo; // FALSE, same value
b = dateOne > dateTwo; // FALSE, same value
b = dateOne <= dateTwo; // TRUE, same value
b = dateOne >= dateTwo; // TRUE, same valueAnd how to convert a string to COleDateTime object?? Use
ParseDateTime
.
Nibu thomas Software Developer
hi nibuthomas, if i have selected two dates from DateandTime Picker Control and put it in EditBox. this values are in the CString Format but they are not in COleDateTimeControl then how to Compare it. please provide a Solution for that. thanks, uday. uday kiran
-
hi nibuthomas, if i have selected two dates from DateandTime Picker Control and put it in EditBox. this values are in the CString Format but they are not in COleDateTimeControl then how to Compare it. please provide a Solution for that. thanks, uday. uday kiran
Take a look at
ParseDateTime
and please kindly:) look up the documentation for further details.
Nibu thomas Software Developer
-
Take a look at
ParseDateTime
and please kindly:) look up the documentation for further details.
Nibu thomas Software Developer
hi nimuthomas, i got it and many thanks to provide a solution. i am lucky. thanks and regards, uday. uday kiran