I am trying to subtract two dates from each other in c#. My current code looks like this:
protected void Page_Load(object sender, EventArgs e)
{
System.DateTime matchStart = new System.DateTime(2012, 10, 17, 20, 00, 00);
System.DateTime currentDateTime = new System.DateTime(2012, 10, 9, 14, 00, 00);
System.TimeSpan matchCountdown = matchStart.Subtract(currentDateTime);
countdown.Text = matchCountdown.ToString();
}
This currently gives me the result "8.06:00:00". What I am trying to do however, is to get the time difference formatted so it says "8 days, 6 hours, 0 minutes". How on earth do I get on about doing this?
Any help is much appreciated!