"Jcs_5920" wrote:
Hello All, I was reading some of the posts trying to learn about date
coding schemes used in old DOS programs with no luck, so I though I'd
ask the group for help.
These are the HEX values and corresponding dates I am using. If anyone
can help me figure out the encode / decode method I would really
appreciate it.
Date only, no time stored.
9C07 0B00 = 01-15-80
9D07 0B00 = 01-16-80
BB07 0B00 = 02-15-80
BC07 0B00 = 02-16-80
3D2C 0B00 = 09-17-05
3E2C 0B00 = 09-18-05
Please help, I'm new to programming & trying to learn on my own.
A bit off-topic (should really go to a general programming
group such as "comp.programming", or maybe a DOS group such
as "comp.os.msdos.misc")...
.... but I see the answer, so I'll reply briefly.
The hex numbers on the left are days, in little-endian format.
Do the math: 000B2C3E(Hex) = 732222(Dec).
Divide by 365.25 and get 2004.7146 years, which is around
September 18 of a year which is 2004 years past some "base"
year. Hence that base year must have been the year 1AD.
(Which makes sense, because there was no year "0".)
So your encoding scheme is, "days since 1-1-1AD, in hex,
little-endian".
Which means DOS, under the surface, was sort-of Y2K compliant,
even though it only displayed 2-digit years. Interesting.
--
Cheers,
Robbie Hatley
Tustin, CA, USA
email: lonewolfintj at pacbell dot net
web: home dot pacbell dot net slant earnur slant