Hi All,
I am having problems with a RTC1307. The following code on a Uno is working perfectly but is 1.5 hours too fast in data logging the time. I don’t know if this is an issue but I live in Central Standard Time Australia Daylight Savings and it appears to be displaying Eastern Standard Time not DLS.
Is there any way I can code the Serial.Print to minus the 1.5 hour time differnece?
Any help is much appreciated.
JC
#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 RTC;
void setup () {
Serial.begin(9600);
Wire.begin();
RTC.begin();
// Check to see if the RTC is keeping time. If it is, load the time from your computer.
if (! RTC.isrunning()) {
Serial.println("RTC is NOT running!");
// This will reflect the time that your sketch was compiled
RTC.adjust(DateTime(__DATE__, __TIME__));
}
}
void loop () {
DateTime now = RTC.now();
Serial.print(now.day(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.year(), DEC);
Serial.print(' ');
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
delay(1000);
}