Datasheet

Serial.print(hour, DEC);
Serial.print(":");
Serial.print(minute, DEC);
Serial.print(":");
Serial.print(second, DEC);
Serial.print(" ");
Serial.print(month, DEC);
Serial.print("/");
Serial.print(dayOfMonth, DEC);
Serial.print("/");
Serial.print(year, DEC);
Serial.println(" ");
}
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void loop()
{
delay(2000);
/*T(00-59)(00-59)(00-23)(1-7)(01-31)(01-12)(00-99) -
T(sec)(min)(hour)(dayOfWeek)(dayOfMonth)(month)(year) - T Sets the date of
the RTC DS1307 Chip.
Example to set the time for 02-DEC-10 @ 19:57:11 for the 3 day of the
week, send this command - T1157193021210
*/
if (Serial.available())
{ // Look for char in serial que and process if found
command = Serial.read();
if (command == 84)
{ //If command = "T" Set Date
setDateDs1307();
getDateDs1307();
Serial.println(" ");
}
while(1)
{
getDateDs1307();
delay(1000);
}
}
}