#include <Wire.h>
#include <RTClib.h>
RTC_DS1307 myrtc;
DateTime mynow;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Wire.begin();
myrtc.begin();
}
void loop() {
// put your main code here, to run repeatedly:
unsigned int thn;
byte bln,tgl;
mynow = myrtc.now();
Serial.print (mynow.year());
Serial.print("/");
Serial.print (mynow.month());
Serial.print("/");
Serial.print (mynow.day());
Serial.print("-");
Serial.print (mynow.hour());
Serial.print(":");
Serial.print (mynow.minute());
Serial.print(":");
Serial.println (mynow.second());
delay(5000); // this speeds up the simulation
thn = mynow.year();
bln = mynow.month();
tgl = mynow.day();
}