Skip to content

Instantly share code, notes, and snippets.

@MRdNk
Last active December 14, 2015 05:48
Show Gist options
  • Select an option

  • Save MRdNk/5037407 to your computer and use it in GitHub Desktop.

Select an option

Save MRdNk/5037407 to your computer and use it in GitHub Desktop.
Useful TotalMonths calculation, that extends the DateTime type.
public static int TotalMonths (this DateTime start, DateTime end) {
return (start.Year * 12 + start.Month) - (end.Year * 12 + end.Month);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment