How do I get TimeSpan in minutes given two Dates?

Solution 1:

TimeSpan span = end-start;
double totalMinutes = span.TotalMinutes;

Solution 2:

Why not just doing it this way?

DateTime dt1 = new DateTime(2009, 6, 1);
DateTime dt2 = DateTime.Now;
double totalminutes = (dt2 - dt1).TotalMinutes;

Hope this helps.

Solution 3:

I would do it like this:

int totalMinutes = (int)(end - start).TotalMinutes;

Solution 4:

double totalMinutes = (end-start).TotalMinutes;