How to get customized quarter of the year in Java?
<p>The requirement is:</p>

<p>Completed in Q1 2012 – Jan 1st to and including April 1st.  (for Q1-2012 only)</p>

<p>Completed in Q2 2012 – April 2nd to and including July 1st </p>

<p>Completed in Q3 2012 – July 2nd to and including Oct 1st</p>

<p>Completed in Q4 2012 – Oct 2nd to Jan 1st (next year) </p>

<p>So far: 
<code>Calendar cal Calendar.getInstance(Locale.US);</code></p>

<p><code>cal.setTime(date);</code></p>

<p><code>int month = cal.get(Calendar.MONTH);</code>     </p>

<p><code>int quarter = (month / 3) + 1;</code>     </p>

<p>But how do I get to include the April 1st in the first quarter and so on? That's where I turn blank.</p>

<p>I'm a bit at lost on how to do this and I'm stuck at it for a while now. Any help will be greatly appreciated. Thanks.</p>
