RTClib: problems in setting date and time

Hi Everybody!
I trying to use the RTClib at the Arduino 0022ubuntu0.1 but I had some problems in set the correct date and time.

I'm using the example ds1307, but the result is

2000/0/0 0:0:0
 since midnight 1/1/1970 = 2313941504s = 26781d
 now + 7d + 30s: 2043/5/6 17:32:14

I read the the time was set by the instruction:

if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
  }

And I read that this instruction take the computer date and time to set de rtc1307 date.

I just tryed the same code in two different computers (my own with ubuntu and another one with windows), but the result is the same. Does anyone know how to solve this?

Thanks everybody!

Regards!

And I read that this instruction take the computer date and time to set de rtc1307 date.

That does not take the current computer date and time. That takes the date and time that the sketch was compiled.

Snippets don't cut it. Post all of your code.

if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
  }

I seem to recall having trouble with this too. Do you ever see "RTC is NOT running!" on the serial monitor. I don't think I ever did, so I just removed the test and commented out the RTC.adjust() unless I needed to reset the clock.