How to get the difference of two time and get MM:SS of time
Code Behind :
DateTime locCurrentDateTime = System.DateTime.Now;
TimeSpan difference = locCurrentDateTime.Subtract(Convert.ToDateTime(Session[“starttime”]));
double hrs = Math.Floor(difference.TotalMinutes);
double sec = difference.Seconds;
string time = new DateTime(difference.Ticks).ToString(“mm:ss”);
Note :
output for above code will be find total minutes between two time and formatted as MM:SS