//Get the time right now
Calendar calendar = Calendar.getInstance();
//Set it to the first day of whatever month it is now
calendar.set(Calendar.DAY_OF_MONTH, 1);
//Now get the day of the week
int firstDayOfMonthAsDayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
Does that look right? So why is the first day of the week being returned as 5? I don't get it; 5 is a Thursday.
The clock and everything on my computer is correct so I must have completely misunderstood how to use the date stuff.
I'll run it in a second But I realised my own stupidity when I found the year was 3007. I'd used the same calendar instance earlier to create a 2000 year range (don't ask! -- it's scientific app) in a spinner. Stupid me