Char array issue (date manipulation/using array to convert month number to month text)

I hope this is just a newbie "Oops".

For context, I'm using the Adafruit RTCLib. I'm reading data from a DS1307 RTC: communication with the chip is fine.

I have two arrays:

char daysOfTheWeek[7][10] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
char monthsOfTheYear[12][10] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};

The daysOfTheWeek came from an Adafruit tutorial. I created the monthsOfTheYear following the example.

However, when I run this code:

Serial.print("Day of the week ");
Serial.print(now.dayOfTheWeek());
Serial.print(" is ");
Serial.println(daysOfTheWeek[now.dayOfTheWeek()]);
Serial.print("Month ");
Serial.print(now.month());
Serial.print(" is ");
Serial.println(monthsOfTheYear[now.month()]);
Serial.println();
delay(5000);

my output is:

Day of the week 2 is Tuesday
Month 11 is December

The day of the week is correct, but the month is wrong. What am I doing wrong?

now.month() returns the values 1..12, but you need to access your array from 0..11 so just subtract 1

Serial.println(monthsOfTheYear[now.month()-1]);

Thank you. What I need to understand, though, is why days works but months doesn't. The DS1307 puts out numbers (01-07 for days and 01-12 for months).

no, it puts out days as 0..6

Actual library code for dayOfTheWeek()

/**************************************************************************/
/*!
    @brief  Return the day of the week.
    @return Day of week as an integer from 0 (Sunday) to 6 (Saturday).
*/
/**************************************************************************/
uint8_t DateTime::dayOfTheWeek() const {
  uint16_t day = date2days(yOff, m, d);
  return (day + 6) % 7; // Jan 1, 2000 is a Saturday, i.e. returns 6
}

Thank you, thank you, thank you! I never thought to go read the library.