title: Finding day of a date in Java
body: <p>I want to find out the day of the date in Java for a date like <code>27-04-2011</code>.  </p>
  
  <p>I tried to use this, but it doesn't work:</p>
  
  <pre><code>Calendar cal = Calendar.getInstance();
  int val = cal.get(Calendar.DAY_OF_WEEK);
  </code></pre>
  
  <p>It gives the integer value, not the String output I want.  I am not getting the correct value I want.  For example it is giving me value <code>4</code> for the date <code>28-02-2011</code> where it should be 2 because Sunday is the first week day.</p>