title: How to find which day of the week it is - Java
body: <p>there has been a few other question which are pretty much the same, but i cant seem to get my bit of code to work. I get the user input which is there birthday dd/mm/yyyy. I'm ignoring leap years by the way. Im trying to determine what day of the week it was when the user was born. I have to determine how many days they were born from a certain date which in this case is Tuesday the 1st of January 1901. That's why ive done <code>year-1901</code></p>
  
  <p>day=<code>int day;</code></p>
  
  <p>used a switch to determine how many days in each month which is represented by <code>dayMonth</code>
  so July has 31, feb has 28 etc.</p>
  
  <p>year=<code>int year;</code> </p>
  
  <pre><code>String[] days =
           {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
  howManyDays = ((year-1901)*365 + dayMonth + day - 1);       
  whatDay = (howManyDays%7);
  days[whatDay]
  </code></pre>
  
  <p>It works sometimes, but then sometimes it doesn't.
  Any help is appreciated, if any questions feel free to ask. Thanks in advance and hope it makes sense!</p>