-1

So in my android app, the user can add a date as a string of 6 characters YYMMDD. This String I then divide into 3 substrings, year, month, day.

Then I use an instance of calender to check whenever this date is a weekday, saturday or sunday, like this:

   Calendar c = Calendar.getInstance();
    c.set(year,month,day);
    int dayOfWeek = c.get(Calendar.DAY_OF_WEEK) ;

As I have learned, sunday is = 1 and saturday = 7. When I test this these are the results I get: 160517 res=4//it's tuesday, but 4 means wednesday. 160514 res=1//it's saturday but 1 means sunday.

Essej
  • 892
  • 6
  • 18
  • 33
  • 1
    The Gregorian calendar didn't come into use until 1582, so the year 16 would be a Julian date. – stark May 17 '16 at 17:23

1 Answers1

0

I was checking the year 16, not 2016. Just wrong by 2000 years.

Essej
  • 892
  • 6
  • 18
  • 33