DateTime dd1 = Convert.ToDateTime(textBox1.Text); DateTime dd2 = Convert.ToDateTime(textBox2.Text); if (dd1.CompareTo(dd2) == 1) { //Textbox1 Date Is Greater Than Textbox2 Date... MessageBox.Show(dd1.Date.ToShortDateString() + " Is Greater Than " + dd2.Date.ToShortDateString()); } else if (dd1.CompareTo(dd2) == -1) { //Textbox2 Date Is Greater Than Textbox1 Date... MessageBox.Show(dd2.Date.ToShortDateString() + " Is Greater Than " + dd1.Date.ToShortDateString()); } else { MessageBox.Show("Both Dates Are Equal."); }
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: