title: Gregorian calendar Day_Of_Week returns wrong day
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4598036/java-calendar-setting-incorrectly">Java Calendar Setting Incorrectly</a>  </p>
  </blockquote>
  
  
  
  <p>i have this code:</p>
  
  <pre><code>GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance(Locale.FRENCH);
  cal.setFirstDayOfWeek(Calendar.MONDAY);
  cal.set(Integer.parseInt(Year), Integer.parseInt(Month), Integer.parseInt(Day));
  int weekday= cal.get(Calendar.DAY_OF_WEEK);
  </code></pre>
  
  <p>If i pass for example 2012-04-02 (a Monday) weekday = 4. And if i pass 2012-04-06(a Friday) weekday = 1. So gregorianCalendar thinks friday is the first day altough I said Monday is the first day? How to fix this?</p>
  
  <p>Thanks in advance!</p>