I have made a function for you.
I think that this will be very helpful.
However, I have no Arduino, and I am in an internet cafe, so I don't really have a chance to debug my code.
Here it is, though.
boolean therini_ora(uint16_t yyyy, uint8_t mo, uint8_t dd, uint8_t hh) {
// are we in Daylight Saving Time (for Greece) ?
// rule current as of year 2015
uint8_t yearcode = (yyyy + yyyy/4 - yyyy/100 + yyyy/400 + 3) % 7;
// yearcode is a code for the calendar for the year
// if March 1 is Sunday, yearcode is 0; if Monday, yearcode is 1, etc.
// from this we can calculate other dates
uint8_t changedate;
if (mo<3) return false;
if (mo==3) {
changedate = 31-((yearcode+2)%7); // date of last Sunday in March
if (dd<changedate) return false;
if ((dd==changedate) && (hh<3)) return false;
return true;
}
if (mo<10) return true;
if (mo==10) {
changedate = 31-((yearcode+6)%7); // date of last Sunday in October
if (dd<changedate) return true;
if ((dd==changedate) && (hh<3)) return true;
return false;
}
return false;
}
The way you use this function is this:
You keep your RTC on "winter" time all year. You never adjust your RTC for Daylight Saving Time.
What you do instead is, you take my function and it will tell you whether to use Daylight Saving Time (for Greece) or not.
You have to put the year, month, day, and hour into the function, and it will tell you "true" (which means it is summer and you should add 1 to the hours) or else "false" (which means it is winter and you should leave the hours alone).
Warning #1: If you add 1 to the hours, then you might get 23+1 which is 24, which means you need to add 1 to the days, which means you might get 31+1=32 which means you need to add 1 to the months and so forth. But I think this is still better than messing with the time on your RTC.
Warning #2: I have not tested this code so please try it out on a few dates in March and October and see if it gives you the right answers.
I am sorry if my explanation is so long and complicated. But I think you will find the code simple and easy to use, even if the explanation is very complicated.