Wednesday, March 26, 2008

Find Date difference ( C# )


We can find the number of days between two datetime.

Below is the code:

DateTime date = Convert.ToDateTime("3/1/2008");
DateTime now = DateTime.Now;

now.Subtract(date).Days

No comments: