>So I'm curious now -- you can all tell that I'm a dilettante programmer
(in
>my other life I'm about to be a doctor).  Why can the palmOS only handle a
>127 year span when only a few bits more could have obviated the whole
>problem?  Seems penny-wise and pound-foolish.

Marketing reasons.  The original Pilot design had to be competetive with
comparable products of the time.  Those products could store tons of data
in a small amount of space.  The Pilot had to be able to make the same
claims.  Thus, date information was packed into a two-byte field: 5 bits
for the day, 4 for the month, and 7 for the year == 16 bits.

The mistake was probably exposing this packing in the API.

(Another mistake was storing the date as day/month/year, when simply
storing "number of days since 1904" as a 16-bit field would have yielded a
range of 179 years.)

-- Keith



Reply via email to