jarzebski/Arduino-DS3231

Incorect work whis unixtime

ASergeyV opened this issue · 0 comments

Using TimeLib.h and DS3231.h.
Arduino code:

dt = DS3231clock.getDateTime();
s += "<br>Local Time: " + printDigits(day()) + "-" + printDigits(month()) + "-" + String(year()) + " " + printDigits(hour()) + ":" + printDigits(minute()) + ":" + printDigits(second());
s += "<br>Local Unix Time: " + String(now());
s += "<br>DS3231 Time: " + String(DS3231clock.dateFormat("d-m-Y H:i:s", dt));
s += "<br>DS3231 Unix Time: " + String(DS3231clock.dateFormat("U", dt));

result:
Local Time: 16-06-2016 13:37:53
Local Unix Time: 1466084273
DS3231 Time: 16-06-2016 13:37:53
DS3231 Unix Time: 1465994273

Why the difference in 90000 seconds?
Also, do not put the correct unixtime in setDateTime function