Index: RTC.c =================================================================== diff -u -r6ec7641862d18619b73daa16f15d0af11e27142a -rbbbc761074f022478088fb5db64a63732773bca9 --- RTC.c (.../RTC.c) (revision 6ec7641862d18619b73daa16f15d0af11e27142a) +++ RTC.c (.../RTC.c) (revision bbbc761074f022478088fb5db64a63732773bca9) @@ -908,10 +908,11 @@ if ( days >= dayCnt ) { dtTime.months = i + 1; + dtTime.days = days - dayCnt; } dayCnt += daysInMonth[ i ]; } - dtTime.days = days; + dtTime.days += 1; // days will be number of full days in current month so need to add 1 for the partial current day to get day of month dtTime.hours = hours; dtTime.minutes = mins; dtTime.seconds = secs;