Final Question - How to set Wire.Write

#include "Wire.h"
#define DS1307_ADDRESS 0x68
byte zero = 0x00; //workaround for issue #527


void setup(){
  Wire.begin();
  Serial.begin(9600);
  setDateTime(); //MUST CONFIGURE IN FUNCTION
}

void loop(){
  printDate();
  delay(1000);
}

void setDateTime(){

  byte second =      10; //0-59
  byte minute =      0; //0-59
  byte hour =        2; //0-23
  byte weekDay =     2; //1-7
  byte monthDay =    1; //1-31
  byte month =       3; //1-12
  byte year  =       11; //0-99

  Wire.beginTransmission(DS1307_ADDRESS);
  Wire.write(zero);

  Wire.write(decToBcd(second));
  Wire.write(decToBcd(minute));
  Wire.write(decToBcd(hour));
  Wire.write(decToBcd(weekDay));
  Wire.write(decToBcd(monthDay));
  Wire.write(decToBcd(month));
  Wire.write(decToBcd(year));

  Wire.write(zero); //start 

  Wire.endTransmission();

}

byte decToBcd(byte val){
// Convert normal decimal numbers to binary coded decimal
  return ( (val/10*16) + (val%10) );
}

byte bcdToDec(byte val)  {
// Convert binary coded decimal to normal decimal numbers
  return ( (val/16*10) + (val%16) );
}

void printDate(){

  // Reset the register pointer
  Wire.beginTransmission(DS1307_ADDRESS);
  Wire.write(zero);
  Wire.endTransmission();

  Wire.requestFrom(DS1307_ADDRESS, 7);

  int second = bcdToDec(Wire.read());
  int minute = bcdToDec(Wire.read());
  int hour = bcdToDec(Wire.read() & 0b11111); //24 hour time
//  int weekDay = bcdToDec(Wire.read()); //0-6 -> sunday - Saturday
//  int monthDay = bcdToDec(Wire.read());
//  int month = bcdToDec(Wire.read());
//  int year = bcdToDec(Wire.read());

  //print the date EG   3/1/11 23:59:59
//  Serial.print(month);
//  Serial.print("/");
// Serial.print(monthDay);
// Serial.print("/");
//  Serial.print(year);
///  Serial.print(" ");
  Serial.print(hour);
  Serial.print(":");
  Serial.print(minute);
  Serial.print(":");
  Serial.println(second);

}

So... I have no clue how this happened but I stumbled upon this code... and well I enter my numbers here

byte second =      10; //0-59
  byte minute =      0; //0-59
  byte hour =        2; //0-23
  byte weekDay =     2; //1-7
  byte monthDay =    1; //1-31
  byte month =       3; //1-12
  byte year  =       11; //0-99

And it gives me exactly what I need!

2:2:17
2:2:18
2:2:19
2:2:20
2:2:21
2:2:22
2:2:23
2:2:24
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80
0:0:80

This is an issue I'm getting every now and then, is it because of my battery? The guy had told me it might be dead.

Maybe, don't know. It does equal the reset state of the DS. Because bit7 of the seconds register is HALT (aka, don't run).

But if you randomly copy and past pieces of code you don't know how you found, I would say it's easier to grab a real library...

septillion:
I would say it's easier to grab a real library...

amen. If you are not familiar with the device at the hardware level, and you are proceeding so slowly, you may want to take the major shortcut.

Unless of course your homework assignment is to configure the RTC using only the Wire library. :-[