Yes, you asked him for a week - and February 28 was Monday, the second day . Please note that in the code you provided, you do not actually set the date anywhere - it just uses the current date, which is Wednesday, so you get 4. If you could show how you are trying to set the calendar to a different date (for example February 28), we can decide why this does not work for you.
If you want to format it as text, you can use SimpleDateFormat and the qualifier "E". For example (untested):
SimpleDateFormat formatter = new SimpleDateFormat("EEE"); String text = formatter.format(cal.getTime());
Personally, I would avoid using Calendar at all, though - use Joda Time , which is a much more advanced API with date and time.
Jon skeet
source share