incorrect week_of_year
<p>Have next function to get week of year:</p>

<pre><code>static public Integer getWeek(Date date) {
    Calendar cal = Calendar.getInstance();
    cal.setMinimalDaysInFirstWeek(1);
    cal.setTime(date);
    Integer week = cal.WEEK_OF_YEAR;
    Integer month = cal.MONTH;
    if ((week == 1) &amp;&amp; (month == 12)) week = 52;
    return week;
}
</code></pre>

<p>Call the function with date=02.01.2013</p>

<p>What I see in debug:</p>

<ol>
<li>date = Wed Jan 02 00:00:00 SAMT 2013</li>
<li>week = 3</li>
<li>month = 2</li>
</ol>

<p>I want to get: week=1, month=1. Right?</p>

<p>Where am I wrong?</p>

<p>JRE 1.6</p>

<p>Thanks a lot for advance.</p>
