Nope.
TempA=CounterA//4
2000//4=0
2004//4=0
etc etc
OK, CounterA holds 0 for 2000, 4 for 2004 etc etc, the '2000' is implied.
TempA=0 only when there is a leap year...
We use it twice in the routine... once with whole years by adding a day to any leap year. But when we calculate out a date that ends on a leap year itself, we have to add 1 additional day to February's month total. So that Februarys days read from EEPROM (or LOOKUP) is adjusted.
That particular routine I did check before I posted it... and I've since checked the CalculateLinearSeconds one too, and both work as expected. I'll post the Data-entry routines shortly.
Meanwhile... you can do a test like this to check for yourself...
DAY=24
MONTH=12
YEAR=66 ' 2066 Implied
Gosub CalculateLinearFromDate
'
' at this point DAYS=24464
'
HOURS=14
MINUTES=37
SECONDS=46
Gosub CalculateLinearSeconds
LCDOut $FE,$C0,"$",HEX4 TempA,HEX4 TempB
Your LCD should display $7DFD25BA
This equates to the decimal number 2113742266.
A quick calculator check of (24464*86400)+(14*3600)+(37*60)+46 confirms we're doing something right!
Now feed that figure back through the routines I posted yesterday and you get... surprise, surprise...




Bookmarks