RTC calendar

Questions about the BASICtools and MakeItC
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

RTC calendar

Post by YahooArchive »

Greets,

I assume you're aware that the leap year calc in RTC.bas undoes Pope Gregory
XIII's calendar reform. :-)

Properly it should read:

if ((RTC_YEAR and 0x3) = 0) and (RTC_MONTH > 2) then
if ((RTC_YEAR MOD 100) = 0) then
if ((RTC_YEAR MOD 400) = 0) then days = days + 1
else
days = days + 1
end if
end if

Of course this is highly unlikely to be an issue for about another 89.75 years,
by which time we'll almost certainly be dead and gone... But I'll bet that was
exactly the rationale they used when implementing date types based on a 2-digit
year -- let us not forget the turmoil at the turn of the millenium: Stock
market indecision and unrest, people crying doomsday stashing money and food in
their basements, COBOL programmers making $250/hr -- utter chaos! :-)

I for one don't want anyone cursing this oversight with my name on their lips,
come 2100-03-01! (Unless of course correct calcs degrade performance enough to
make them curse me today, but that would make it a trade-off rather than an
omission.) :-)


-MM



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: RTC calendar

Post by YahooArchive »

> I assume you're aware that the leap year calc in RTC.bas undoes Pope Gregory
XIII's calendar reform. :-)
>

Thanks for pointing that out, its been updated.

Actually it was part of our evil plan to destroy the world :)

When did COBOL programmers make $250/hr, in college I was getting $10, but that
was a lot of years ago.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: RTC calendar

Post by YahooArchive »

In the late 1990's, as companies rushed to update their legacy systems before
the Y2K deadline, head hunters were looking high and low for COBOL programmers
with enterprise-level experience. Supply and demand drove the rate [like it
drives everything else] with a heavy hand.

In retrospect it made us regular old C/C++ programmers feel unwanted/unloved.
Everyone was looking into either squeezing another decade out of their legacy
systems (into which they had invested mega-bucks, but often had less compute
than modern desktop PCs), or into doing the unheard-of, bordering on insanity
(e.g., the SSA was accepting bids for a re-write of their system in Smalltalk...
LOL)


-MM

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: RTC calendar

Post by YahooArchive »

--- In ARMexpress@yahoogroups.com, "Mark" wrote:
>
> Of course this is highly unlikely to be an issue for about another 89.75
years, by which time we'll almost certainly be dead and gone...

On the topic of date-related bugs, an earlier one to watch out for is the 'Year
2038 bug'. I'm planning to still be around then ...

http://www.2038bug.com/

Regards,
Chris

Chris Burrows
CFB Software
Astrobe: LPC2100 Oberon-07 Development System
http://www.astrobe.com

Post Reply