.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Post New Resource Bookmark and Share   

Find DateDiffrence Between two dates

Posted By:Kirtan       Posted Date: June 30, 2010    Points: 10    Category:    URL: http://www.dotnetspark.com  

Find Difference Between two dates
 

 DateTime dt1 = DateTime.Now;
        DateTime dt2 = DateTime.Now.AddDays(30);

        TimeSpan t1 = dt2.Subtract(dt1);

        Response.Write("Date Time Diffrence in Days :" + t1.Days);

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend