Adafruits ds3231 and 24 hour format

I'm looking for an elegant solution to this stupid problem, the rtclib doesn't use 24 hour format and there is no am/pm thing either. Which is working me up, cause I just want to put this together. I don't want to do a bunch of math if i dont have to, i read there is a way to set a bit on the ds3231 to report in 24 hour mode.

which one?

show

Sorry I meant adafeuits rtclib and a ds3231

Why go through the entire trouble of making a library if you can’t even tell day from night? I just know there is a one line code to set the ds3231 into 24hr mode. But everyone that knows wants me to kill myself on it.

So use one of the many libraries that support it.

my adafruit lib show in 24h format

where? what code you use? is there such line?

1 Like

There appears to be a #define instruction:

https://forums.adafruit.com/viewtopic.php?t=188129

Thanks, if your lib is showing in 24hr format it’s because your etc is in 24hr mode. The #define is just referencing some code further down the sketch, for their stupid clock. And I already changed libraries once and now I have to do it again.

I figured it out, atleast i think i have. Its so weird the adafruit library uses the same thing as the DS3231 library, with the now example sketch. But then the DS3231 library goes a step further and actually returns am or pm for you with getHour(h12, hPM)
I told lady ada on the adafruit forums she needs to stop releasing snakes onto the internet and she banned me from the subforum.

If the libraries are stupid write one that is not and post it so we can see what a good library is like.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.