DotNet Academy of Rajesh Rolen

Solutions by Rajesh Rolen

How To Find Number of Days between two Dates in C# Asp.Net?

To calculate the number of days between two dates in Asp.Net using C#, use the below piece of code.
TimeSpan timespan = Convert.ToDateTime("2009-12-31").Subtract(Convert.ToDateTime("2009-01-01"));
Response.Write(timespan.Days+1);

Here we use Subtract method to find the difference between two dates. Usually the Subtract method return a value that is one less than the correct value. So to the Timespan object Days property we can add 1 to get the exact number of days.

2 comments:

Biswa October 16, 2009 at 3:20 AM  

Good.

Anonymous January 16, 2010 at 4:29 PM  

бесплатное новое порно
фото девушек порно бесплатно
танцы живота видео скачать бесплатно
тhе телки сергей минаев скачать
порно рассказы про тещу
порно видео зоофилы бесплатно
трансляция порно видео
васильева татьяна секс
порнография dvd
фотографии порно лесбиянок

Post a Comment

About this blog

Blog Archive

My Blog List

Advertise On This Site

Site Info

Advertise on this Site

To advertise on this site please mail on RajeshRolen@gmail.com

Information Source

About

Pages

Dot Net Academy

Advertis in This Area of Site

Powered by Blogger.

Followers

Blog Archive

Search This Blog