title: Calculate the start date of a Financial Quarter a date is in
body: <p>Assume Financial Quarters always start on the 1st of a month and they are always 3 calendar months long.</p>
  
  <p>Different organisations start their Financial Year (FY) in different months - some may be 1st April , some may be 1st July or could be just 1st Jan (which will match normal Calendar Quarters).</p>
  
  <p>Given a date and a month that the FY starts on how can you determine the start of the quarter that the date falls in.</p>
  
  <p>E.g.</p>
  
  <pre><code>DateTime getStartOfFinancialQtr(DateTime date, int monthFinancialYearStartsOn)
  </code></pre>
  
  <p>15th Jan when FY starts Jan would = 1st Jan</p>
  
  <pre><code>getStartOfFinancialQtr(new DateTime(2013,1,15), 1) == new DateTime(2013,1,1)
  </code></pre>
  
  <p>15th August when FY starts April would be 1st July</p>
  
  <pre><code>getStartOfFinancialQtr(new DateTime(2013,8,15), 4) == new DateTime(2013,7,1)
  </code></pre>
  
  <p>BUT 15th Jan 2013 when FY starts February would be 1st November <strong>2012</strong></p>
  
  <pre><code>getStartOfFinancialQtr(new DateTime(2013,1,15), 2) == new DateTime(2012,11,1)
  </code></pre>