0

I have an I2C Real Time Clock, DS3231 RTC module , and I just want something like Unix Time. I'm using the uRTCLib, looking at the class methods but dont see anything like that. I'm thinking there must be a raw read that would return all the digits. Is there an easy way to do that?

0

1 Answer 1

3

The DS3231 doesn't report the Unix time. It reports the current time in broken-down form (year, month... second). If you need Unix time, you have to compute it.

I suggest using Adafruit's RTClib. This library implements the computation of Unix time, e.g.

uint32_t unix_time = rtc.now().unixtime();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.