Skip to content

Instantly share code, notes, and snippets.

@sergeevyi
Created April 22, 2014 07:03
Show Gist options
  • Select an option

  • Save sergeevyi/11168010 to your computer and use it in GitHub Desktop.

Select an option

Save sergeevyi/11168010 to your computer and use it in GitHub Desktop.
.Net
# Get the number of days between a start date and end date
public string DateDifference(DateTime StartDate, DateTime EndDate)
{
TimeSpan t = EndDate.Subtract(StartDate);
string[] list = t.Days.ToString().Split('.');
return list[0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment