title: Get current week start and end date in Java - (MONDAY TO SUNDAY)
body: <p>Today is 2014-04-06 (Sunday).</p>
  
  <p>The output I get from using the code below is:</p>
  
  <pre><code>Start Date = 2014-04-07
  End Date = 2014-04-13
  </code></pre>
  
  <p>This is the output I would like to get instead:</p>
  
  <pre><code>Start Date = 2014-03-31
  End Date = 2014-04-06
  </code></pre>
  
  <p>How can I achieve this?</p>
  
  <p>This is the code I have completed so far:</p>
  
  <pre><code>// Get calendar set to current date and time
  Calendar c = GregorianCalendar.getInstance();
  
  System.out.println("Current week = " + Calendar.DAY_OF_WEEK);
  
  // Set the calendar to monday of the current week
  c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
  System.out.println("Current week = " + Calendar.DAY_OF_WEEK);
  
  // Print dates of the current week starting on Monday
  DateFormat df = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
  String startDate = "", endDate = "";
  
  startDate = df.format(c.getTime());
  c.add(Calendar.DATE, 6);
  endDate = df.format(c.getTime());
  
  System.out.println("Start Date = " + startDate);
  System.out.println("End Date = " + endDate);
  </code></pre>