Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't compare dates of DateEdit control

Status
Not open for further replies.

CrossofIron

Programmer
Nov 27, 2006
3
AZ
Maybe may question doesn't concern to this forum ,but i have a problem on ComponentOne DateEdit control.
(C1.Win.C1Input.C1DateEdit tmp_regdate)
i can't compare dates,exactly can't find exact event or method

if (tmp_regdate.Value= tmp_regendate.Value)
{
MessageBox.Show("Registration date must to be equal!");
tmp_regendate.Focus();
}

i can't convert tmp_regdate result to date
the value of tmp_regdate like this '12.12.2006 0:00:00'
can anyone help me?
thanx in advance
 
DateTime dt1 = DateTime.Parse(tmp_regdate.Value);
DateTime dt2 = DateTime.Parse(tmp_regendate.Value);

if (dt1.ToString("dd/MM/yyyy").Equals(dt2.ToString("dd/MM/yyyy"))
{
//do your stuff here
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top