HP Forums
HP71B (Ver. 1BBBB) Date Bug? - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: HP71B (Ver. 1BBBB) Date Bug? (/thread-170920.html)



HP71B (Ver. 1BBBB) Date Bug? - M. Joury - 08-23-2010

I often need to know the day of the year in my job. So for fun I decided to write a program for each of my calcs to get this info. Easy enough with a calculator with date support such as a 41C/CV with Time Module or a 41CX or a 48. A little more complex if you don’t have date support. At any rate I had written programs for my 41, 35S, and 42S and had gotten around to taking a look at my 71B.

It took me about 5 minutes from putting in the batteries (I had not played with it in a while) to figure out that this support was built right in. DATE returns YYDDD where YY is the year and DDD is the day of the year. So, no fun here, works right out of the box. I set the correct date and time and keyed in “date” and I got 236 (for 8/23/10)… WOAH! Wrong answer! My 48, 42, 41, and 35 all agree that the correct answer should be 235. I thought about this for a moment and then set the date to 2/28/10. Date = 10059. Ok, all good. Now try 3/01/10. Date = 10061. Uh-Oh. Not so good. It seemed to think that 2010 was a leap year. Ok, so try to ‘setdate “10/02/29”’. Nope, caught that, won’t let it happen. Ok, so ‘setdate 10060’. That works fine. Now try date again. Answer? 10061. Tried the same series of tests for 2011, no problems there. So the calc appears to have a problem with the numeric date routines for 2010 but the setdate routines recognize the fact that 2010 is NOT a leap year just fine. Note that date$ also appears to work correctly in that ‘setdate 10060’ returns the correct string date when DATE$ is used.

I have not bothered to try any other ROM versions which I might get around to a little later as I have a couple more of these beasties.

Cheers,

M. Joury


Re: HP71B (Ver. 1BBBB) Date Bug? - Jerry Raia - 08-23-2010

I'm curious, did you set the year as '2010' or just '10'?


Re: HP71B (Ver. 1BBBB) Date Bug? - M. Joury - 08-23-2010

Just 10. Did I miss something in the docs? Mind you, Year 10 can't be a leap year either and all other dates appear correct.

Now you got me thinking. Back to the drawing board.

Although, it would seem that using 'setdate 10060' should handle any issues of string date formatting that may show up in using 'setdate 10/03/01'. And the fact that setdate 10060 results in date returning 10061 would seem to indicate a problem.

Cheers,

M. Joury


Re: HP71B (Ver. 1BBBB) Date Bug? - M. Joury - 08-23-2010

Here is the example of setdate usage from the manual:

Both these statements set the date to March 7, 1985...

SETDATE 85066

SETDATE "85/03/07"

Of course what you are getting at is 1910 as opposed to 2010. But that is not a leap year either.

I guess I was not seeing the obvious implication of your question in my first response.

Here we go... From the reference manual:

For numeric date inputs and for date string inputs, if you use the two-digit year format, and if:

* 60 <= YY <= 99, then YY = YY + 1900

* 0 <= YY <= 59, then YY = YY + 2000

So I guess the HP71B is Y2K safe <g>.

M. Joury

Edited: 23 Aug 2010, 7:58 p.m.


Re: HP71B (Ver. 1BBBB) Date Bug? - Jerry Raia - 08-23-2010

Yes I thought about that because I had recently resurrected my 71B. The first thing was to set the time and date. Years ago I had written date and time LEX file utilities. I remember how the 71 handled dates and times. Thats why I asked :)


Re: HP71B (Ver. 1BBBB) Date Bug? - J-F Garnier - 08-24-2010

This is a known bug of version 1BBBB: "Invalid leap year determination for even year in odd decade". Was occuring in all these 90's years, and now in 2010, 2012 up to 2018. But will work well again in 2020 :-)

Fixed in versions 2CCCC/2CDCC.

J-F


Re: HP71B (Ver. 1BBBB) Date Bug? - M. Joury - 08-24-2010

Thanks J-F, I was not aware of that. I appreciate the info.

M. Joury


Re: HP71B (Ver. 1BBBB) Date Bug? - BruceH - 08-24-2010

That's actually good news... because now you get to write your program for the HP-71 after all. ;-)


Re: HP71B (Ver. 1BBBB) Date Bug? - M. Joury - 08-24-2010

Thanks Bruce,

I hadn't thought of that aspect of it <g>. I was simply messing with ways to correct the odd decade/even year bug. But what the heck, just roll my own!

Cheer,

M. Joury


Re: HP71B (Ver. 1BBBB) Date Bug? - Karl Schneider - 08-26-2010

Quote:
This is a known bug of version 1BBBB: "Invalid leap year determination for even year in odd decade". Was occuring in all these 90's years, and now in 2010, 2012 up to 2018. But will work well again in 2020 :-)

Fixed in versions 2CCCC/2CDCC.


J-F --

Thanks for the info; did personal modesty preclude you from providing the link to your own fine webpage, where presumably all the known HP-71 bugs are listed? Many users may not know that it moved to a new URL (away from Lycos) since the previous retrieval...

My own HP-71B with 1BBBB ROM exhibited the bug, as might be expected. The bug surprises me, as the leap-year rule is rather straightforward.

-- KS