Just a quick question as I am trying to determine if the RTC is incorrectly set or if 1980 is the correct base date.
Given the un-abbreviated code:
rc = mktm( &myTime, read_rtc() );
day = myTime.tm_mday; month = myTime.tm_mon; year = myTime.tm_year; printf("%02d/%02d/%4d
", month, day, year + 1900 );
output is: 04/19/2024, so the clock is set wrong.
The doc says a value of 80-147 is valid, representing 1980-2147, (a long 0 would then represent 1980), so then the clock is set forward 10 years?
I know this is really basic, but I come from a unix background and January 1, 1970 equates to 0. That being the case, it is too coincidental for me to see 1970 vs. 1980, a 10 year difference, and then seeing the clock be 10 years off based on the math following the doc. Is the doc correct and does the epoch on this rtc really work out to Jan 1, 1980? This just seems odd to me, unless I’ve committed a DFUE? I don’t want to offset the clock improperly, so I have to be sure.
Using Dynamic C 9.62 on a 3710. All updates applied.
Thanks for any clarification.