DS3231 shows year 2034 today

Hi all,

has anyone the same problem with the time lib thinking it is year 2034 today on April 3rd 2016?
Time, day and month are correct. Just the year is wrong. When I set the year to 2016 and write that back to the clock - it is still resolved to 2034.

I'm currently using

And the time library derived from the playground,
http://www.pjrc.com/teensy/td_libs_Time.html

Electrically all is ok as the time is correct except for the year and a Si7021 on the same I2C bus also spits out correct results. I'm just wondering if this is a bug in the code and others experience that as well - and maybe had a deeper look at the code and found the error already.

The clock can be set to any time and date you want.

I cannot get the code now as it is on a USB stick and I am on an iPad.

A search of the site using the Search box should help.

Weedpharma

Um no, of course the search didn't help in any way. And I know that I can set any date and time I want. Thank you for the reply anyways, made me look into the code of those libraries.

If someone else runs into this issue:
The DS3231 stores the year as offset from 2000 and can run until 2099. The year shown depends on the time structure which gets used, there are several available:
now() should return correct calendar date, tmSet returns offset from 1970. When writing to the DS3231, the Christensen code uses an offset to 1970 to store the data.
Thus using a tmSet, setting to 2016 returns 2034 in the end (still don't know why that just happened today and not a month ago ...).
Using tmSet.Year=46 solves the issue, now the year is 2016 again ...