jarzebski/Arduino-DS3231

How to get unixtime into a variable ?

kurt-klingbeil opened this issue · 1 comments

I notice that when the time is not set during setup, the time begins at 2000-1-1 0:0:0
Setting the time to the DATE TIME by default would be silly... we expect the super-accurate clock
to tell us the right time on power up...
I notice there is the call
// clock.setDateTime(Unixtime); to set time using Unixtime,
but there appears to be no call for
Unixtime = get_DateTime(dt);
the closest thing is
Serial.println(clock.dateFormat("U", dt));
to print Unixtime
but not to set the value to a variable

OOPS... premature issue report...
While digging around in DS3231.cpp looking at how I might overcome this "oversight"
I detected the presence of dt.unixtime classmember and sure enough it works - more or less correctly
there is a slight hour discrepancy...