title: Grouping DateTime by arbitrary time intervals
body: <p>Hi I'm attempting to group a collection of objects by their DateTime property and I am having a strange issue. Currently I have the following:</p>
  
  <pre><code>TimeSpan interval = TimeSpan.FromMinutes(45);
  var selected = from date in item.Dates
                 group date by (date.Ticks / interval.Ticks) into g
                 select g;
  </code></pre>
  
  <p>this basically works, but if the time of the first item is 11:45 then the first group is only 15 mins long. Followed by the next group starting at 12:00 and from there grouping correctly. Am I missing something really simple, or do I need to change the way I attempt to group? What I'm really trying to do is group all my objects into 45 minute chunks. </p>