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 theclass methodsbut 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?

Juraj's user avatar
Juraj
18.3k4 gold badges32 silver badges50 bronze badges
askedDec 31, 2022 at 19:17
j0h's user avatar
0

1 Answer1

3

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

I suggest using Adafruit'sRTClib. This library implements thecomputation of Unix time, e.g.

uint32_t unix_time = rtc.now().unixtime();
answeredDec 31, 2022 at 20:47
Edgar Bonet's user avatar

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy 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.