3dword
DST_GetNextTransition(
byte ruleOrdinal,
byte ruleDay,
byte ruleMonth,
byte ruleHour,
byte ruleMin, word ruleYear)
10 byte month, day, weekDay;
12 tempDate = TAP_MakeMjd(ruleYear, ruleMonth, 1);
14 TAP_ExtractMjd(tempDate, &year, &month, &day, &weekDay);
16 tempDate = tempDate + ruleDay - weekDay;
20 tempDate = tempDate + (ruleOrdinal * 7);
24 tempDate = tempDate + ((ruleOrdinal - 1) * 7);
27 TAP_ExtractMjd(tempDate, &year, &month, &day, &weekDay);
29 if(month != ruleMonth) {tempDate = tempDate - 7;}
31 returnDate = ((tempDate & 0xffff) << 16) | ((ruleHour & 0xff) << 8) | (ruleMin & 0xff);
dword DST_GetNextTransition(byte ruleOrdinal, byte ruleDay, byte ruleMonth, byte ruleHour, byte ruleMin, word ruleYear)