#include <RTClib.h>
RTC_DS1307 rtc;
char daysOfTheWeek[7][12]={"sunday","monday","tuesday","wednesday","thursday","friday","saturday"};
void setup()
{
Serial.begin(115200);
if(! rtc.begin())
{
Serial.println("Couldn't find RTC");
Serial.flush();
abort();
}
}
void loop()
{
DateTime now = rtc.now();
Serial.print("Current time");
Serial.print(now.year(),DEC);
Serial.print('/');
Serial.print(now.month(),DEC);
Serial.print("(");
Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
Serial.print(")");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.println(now.second(), DEC);
delay(1000);
}