Index: RTC.c =================================================================== diff -u -r519a676a194a6d5045403fb75610acd98569ef97 -rc83387a25db8a1afae0bc2348d61b6a2f562f145 --- RTC.c (.../RTC.c) (revision 519a676a194a6d5045403fb75610acd98569ef97) +++ RTC.c (.../RTC.c) (revision c83387a25db8a1afae0bc2348d61b6a2f562f145) @@ -906,10 +906,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;