Yussi Ariefiyono
substract datetime in c#
Problem:
Substraction datetime in c#, in this case from textboxes
Solution:
DateTime _Text1 = DateTime.Parse(Text1.Text);
DateTime _Text2 = DateTime.Parse(Text2.Text);
System.TimeSpan result = _Text1 – _Text2 ;
Response.Write(result.TotalDays); –> display the total days diffrence
| Print article | This entry was posted by yussi ariefiyono on August 13, 2008 at 4:58 pm, and is filed under asp.net, c#. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |