I have this function that brings me the day of the week:
public static String getWeek(String date){ //ex 07/03/2017
String dayWeek = "---";
GregorianCalendar gc = new GregorianCalendar();
try {
gc.setTime(new SimpleDateFormat("MM/dd/yyyy", BRAZIL).parse(date));
switch (gc.get(Calendar.DAY_OF_WEEK)) {
case Calendar.SUNDAY:
dayWeek = "DOM";
break;
case Calendar.MONDAY:
dayWeek = "SEG";
break;
case Calendar.TUESDAY:
dayWeek = "TER";
break;
case Calendar.WEDNESDAY:
dayWeek = "QUA";
break;
case Calendar.THURSDAY:
dayWeek = "QUI";
break;
case Calendar.FRIDAY:
dayWeek = "SEX";
break;
case Calendar.SATURDAY:
dayWeek = "SAB";
}
} catch (ParseException e) {
e.printStackTrace();
}
return dayWeek;
}
But it's bringing me the day of the previous week, ex: 03/03/2017 Tuesday it brings as Monday.