DS1307 update badly


I don't understand something.

I got a class method that does this job :

void FunctionalTasks::setRealTimeClock() {

    if ( _Tracer!=NULL )
        _Tracer->Print("Heures du systeme embarque mise a jour.");
    RTC.set(DS1307_HR   , 19);     // set the hours
    RTC.set(DS1307_MIN  , 55);     // set the minutes
    RTC.set(DS1307_SEC  , 0);      // set the seconds
    // REGLAGE DATE     
    RTC.set(DS1307_DATE , 17);     // set the date
    RTC.set(DS1307_MTH  , 12);     // set the month
    RTC.set(DS1307_YR   , 10);     // set the year
    RTC.set(DS1307_DOW  , 5 );     // set the day of the week


Ok so I launch my sketch with that setup:

void setup()  { 

      // SERIAL

      // LCD
      lcd.begin(16, 2);
      lcd.setCursor(0, 0);

      // pass lcd to tracer and tracer to all others objects
      // FuncTask.setSonicSensor(&sonicsensor);

      FuncTask.setRealTimeClock();   //!!! only if date is out of date

Ok so the time is well displayed on my LCD screen.

Then I comment the line


And then upload the sketch with the line commented.

Then running again my sketch, the date is bad. and day of the week return 0 until 5 as in the first test.

This is my func to get the day title of the week :

      String       getDayOfWeek( )
            String days[8]={ "Jour NaN", "Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche" };

            return days[RTC.get(DS1307_DOW, false)];

Ok it was the false here:

return days[RTC.get(DS1307_DOW, false)];

Change it to true and it is ok