Determining the Day-of-Week for a Particular Date

The day-of-week is an integer value where 1 is Sunday, 2 is Monday, ..., and 7 is Saturday
Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25); int dayOfWeek = xmas.get(Calendar.DAY_OF_WEEK); // 6=Friday Calendar cal = new GregorianCalendar(2003, Calendar.JANUARY, 1); dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 4=Wednesday

Comments

9 Feb 2010 - 9:46pm by Anonymous (not verified)

day of date

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.