how to subtract two dates values store in third text box
subtract two dates values store in third text box
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhay ShankerPosted Jun 20, 2014, 1:14 PM
DateTime firstDate= DateTime.Parse(textBox1.Text);
DateTime secondDate = DateTime.Parse(textBox2.Text);
string daydiff = (secondDate - firstDate).TotalDays.ToString();
textBox3.Text =daydiff2;
VulpesPosted Jun 20, 2014, 12:27 PM
DateTime dt1 = DateTime.Parse(textBox1.Text);
DateTime dt2 = DateTime.Parse(textBox2.Text);
TimeSpan ts = (dt2 - dt1).Duration();
textBox3.Text = ts.ToString();