rtc update with leap year detection