Hy, I wrote the code below and I don't understand why it's not working. For example for today (04.04.2020) dayOfWeek
should be 7, but the result is 2….
Calendar calendar = Calendar.getInstance();
calendar.set(2020, 4, 4);
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
System.out.println(dayOfWeek); //this print 2 on the console