First split the line
String[] out = strDate.split("-"); s1 = Integer.parseInt(out[0]); s2 = Integer.parseInt(out[1]) - 1; yr = out[2]; char a, b, c, d; a = yr.charAt(0); b = yr.charAt(1); c = yr.charAt(2); d = yr.charAt(3); s3 = Character.getNumericValue(a)*1000 + Character.getNumericValue(b)*100 + Character.getNumericValue(c)*10 + Character.getNumericValue(d);
then create an instance of the calendar that day
Calendar cal = Calendar.getInstance(); cal.set(s3, s2, s1);
then get the day
cal.get(Calendar.DAY_OF_WEEK);
source share