HP Forums

Full Version: Date algorithm.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hi, everybody!

I wonder if sometime "hp" publishes her algorithm to calculate the date, by given date and number of days?

Any other algorithm appreciated also.

Best regards, Tal email: td@chem.ch.huji.ac.il

As far as I know, that means up to the 41 series, HP always published their formulas agorithm. I remember I saw the date calculation algorithm on the manual of the HP 1C ans on an application pac for the 34C.

I'll try to find it for you.

Best regards,

Thibaut

For a simple version, see the HP25 Applications Manual; and for a more elaborated version, the HP41 Standard Pac manual (it comes with the calculator, the ROM module was an option).

It's also in the 12C manual, appendix D. I've "borrowed" it a couple of times to stick in various programs that I've built over the years because it's so simple and easy to implement.

here it is:

delta-days = f(d1)-f(d2)

dn = 365(yyyy) + 31(mm-1) + dd + INT(z/4) - x where :

if mm<=2 x=0; z=(yyyy)-1

else x=INT(0.4mm + 2.3); z=(yyyy)