Home/Support/Support Forum/Is 1980 the correct base year from the rabbit 3k rtc?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Is 1980 the correct base year from the rabbit 3k rtc?

0 votes
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\n", 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.
asked Apr 21, 2014 in Rabbit by developer New to the Community (10 points)

Please log in or register to answer this question.

1 Answer

0 votes
you can change the real-time clock by running the sample Samples\RTCLOCK\SETRTCKB.c
This program sets the Rabbit real-time clock from keyboard entry:
valid dates are from 1/1/1980 (entered as 1/1/80) to
12/31/2047 (entered as 12/31/47).
answered Apr 22, 2014 by MargaretK Veteran of the Digi Community (545 points)
...