How To difference betwwen two dates
i enter date in text box choose by calander. but now i want to subract one text box date to other text box date value. my column name date data type is varchar. using code asp.net c#
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.
Om prakash SinghPosted Aug 6, 2011, 6:56 AM
datediff("d",date1,date2)
Subhendu DePosted Dec 14, 2010, 2:11 AM
DateTime dt1 = Convert.ToDateTime(TextBox1.Text);
DateTime dt2 = Convert.ToDateTime(TextBox2.Text);
you can use (dt1-dt2) or dt1.Subtract(dt2)
Thanks.....