The month enum number will likely resolve to an int in the range 0-11 anyway. Just try using it. You may find that you have an off by one error to fix or perhaps you'll be lucky. Cast it if you have to.
The 'try a cast suggestion was the clincher - this compiles - however I will have to wait until I get home (where the H/W is) to do a full test.
Will advise.
Stan
// Include the RTC library
#include "RTC.h"
/* -------------------------------------------------------------------------- */
void setup() {
/* -------------------------------------------------------------------------- */
//Initialize serial and wait for port to open:
int dd=21;
int mm=3;
int yyyy=2023;
int hh=17;
int MM=12;
int ss=04;
// 21-March-2023 17:12:04
RTC.begin();
RTCTime timeToSet(dd, Month::JUNE, yyyy, hh, MM, ss, DayOfWeek::WEDNESDAY, SaveLight::SAVING_TIME_ACTIVE); // This works (Compiles)
RTC.setTime(timeToSet);
RTCTime timeToSet2(dd, (Month)mm-1, yyyy, hh, MM, ss, DayOfWeek::WEDNESDAY, SaveLight::SAVING_TIME_ACTIVE); // This compiles
RTC.setTime(timeToSet2);
}
/* -------------------------------------------------------------------------- */
void loop() {
}