Apart from their names, these two libraries have identical descriptions. Are they actually different?
Can users of the DS3231 RTC recommend their choice for getting a first module set up and running please?
Also, in my \SKETCHES\libraries folder I had a few dozen libraries with names like 'arduino_345904', 'arduino_3495874', etc. I gather that the IDE renames them when it encounters duplicate names and cautiously retains each. (But not with the sort of names that I think would be more helpful like DS3231-A, DS3231-B, etc). Anyway, after studying their contents, I renamed them, if possible using the name given on line 1 of the library.properties file. So libraries\ now has four potentially relevant installed entries. I'm curious why the RinkyDinky one doesn't appear in the Include Library or Manage Libraries section.
Did you install it from the IDE or by downloading from github? I've had two occasions recently when the IDE method resulted in problems, which did not arise using the 'manual' approach.
EDIT Wed 9 Aug 2023 19:38
But in this case both result in identical folders, so I will next try an example from the already installed version. Can you perhaps recall the sketch you first used to set up and run your DS3231 module?
One thing to consider is how the day of week is handled (if you care). Some libraries use the 1-7 numbering of the chip for Sun - Sat. Others map the numbers to 0-6, which is consistent with some C date functions.
I use the Rtc by Makuna library which uses the 0-6 numbering.
That's now that I ran it less impatiently! I duly downloaded and saved as 'DS3231-RTClib-alto.ino and on examination it was identical to one (of several) I had unsuccessfully tried already, DS3231-RTClib.ino.
I now see that was down to me. I had impatiently used an existing UNO-LCD-MP3 Player circuit, my current project, but not surprisingly had some conflict.
On a fresh board with that dedicated sketch it worked immediately.
A particular attraction IMO is that it automatically set its time from the PC system date/time. Several other libraries require that to be done manually by uncommenting a couple of code lines etc.
Will now work on integrating it with the full project.
I'll mark as solved, although still welcome any further advice/tips about using the module with 16x2 LCDs.
I think that you will find that it sets the date/time to the compile time. What happens to the time if you upload the sketch, wait a couple of minutes and reset the Arduino ? Is the time correct now ?
With a new device and an example program it is a good idea, as you have discovered, to have the identical hardware setup.
Or as close as you can manage. Substituting an UNO for a Mega isn't gonna kill you. Usually.
If you find the library you picked does things you don't like, as an example the day numbering 0..6 instead of 1..7 mentioned above, remember that you are the programmer and you wield a certain amount of control over annoyances like that.
In this case, addition (or subtraction) of one (1) at appropriate points in the code lets everyone think about it however they would like. You can often do it in just one or two places, coming and going from the library.
Lastly, be sure if you have the cheap RTC module that seems to be everywhere these days, read and heed the advice at the site Iink here, or google "ds3231 charging circuit" and take your pick:
what you are printing is likely a number, so if the value is 2 and you ask that to be printed, it's normal to get 2. if you want a 0 in front of it, you need to tell the arduino to add that
if (minute < 10) Serial.write('0'); // add padding
Serial.print(minute);
To offer another option, I like to use the DS3232RTC library. It was written specifically to work with the Time libary, so no worry about conflicts in how the date/time is represented, and easy to swap between the DS1307/DS3231/DS3232 RTCs.
what function do you call to print the minutes? is that a library function returning a string?
if you are just asking the value of minutes as a number, and then you do the printing, then it's on you, not the library's author