title: Is this the best way to represent decades with TimeSpan?
body: <p>I'm making a graph that cover <code>"1930-1940", "1940-1950", "1950-1960", "1960-1970", ...</code> </p>
  
  <p>I want to represent this with a <code>DateTime</code> and a <code>Timespan</code>, but I'm not really sure how to make the <code>TimeSpan</code>, and I find it  hard to verify if my timespans are correct.</p>
  
  <p>Is this how I should use <code>TimeSpan</code>, or does it overlap? If it's overlapning then how can I fix it?</p>
  
  <pre><code>List&lt;DateTime&gt; list1 = new List&lt;DateTime&gt;();
  List&lt;TimeSpan&gt; list2 = new List&lt;TimeSpan&gt;();
  
  int startYearInt = 1930;
  
  int times = 0;
  const int intervalSize = 10;
  for (int i = startYearInt; i &lt; 2020; i += intervalSize)
  {
      DateTime sYear = new DateTime(startYearInt + (intervalSize * times++), 1, 1);
      TimeSpan period = (sYear.AddYears(intervalSize)) - sYear;
  
      list1.Add(sYear);
      list2.Add(period); // &lt;&lt;-- Don't know if if this is correct?
  }
  </code></pre>
  
  <p>EDIT:
  I have this too. And if My timespan is too small or to last it can give some problems.</p>
  
  <pre><code>public bool IsInsidePeriod(DateTime dt)
  {
      return dt &gt;= FromYearDateTime &amp;&amp; dt &lt; FromYearDateTime.Add(periodTimeSpan);
  }
  </code></pre>