On 2024-11-13 22:18, Paul Koning wrote:
On Nov 13, 2024, at 2:58 PM, Johnny Billquist
<bqt(a)softjar.se> wrote:
Well. Bad design is not the same as "bug" either. ;-)
It is to me, and I worked in that group.
:-)
I would
suspect the author had some reason (good or bad) for defining it the way it was.
I think extending it to unsigned 16 bits is a very straight forward and obvious way to
fix this.
But to be honest, I think the whole format is completely broken to begin with. Either
just specify it as seconds (or days) after some epoch, or have separate fields for each
component. Julian half-days? Who on earth came up with that idea?
The formula is just horrific:
JULIAN =
(3055*(MONTH+2)/1OO-(MONTH+10)/13*2-91+(1-(YEAR-YEAR/4*4+3)/4)*(MONTH+10)/13+DAY-1+(YEAR-1977)*365+(YEAR-1977)/4)*2
It probably comes from a desire to do things with 16 bit elements.
It could still have been done so much cleaner.
That formula looks painful because the
Julian/Gregorian calendar is. The definition of the value is simply days since epoch,
times two plus 1 if it's afternoon. The point of half-days is to fit the time of day
(in seconds) in 16 bits rather than 17.
I haven't really tried to break up and understand that full expression.
I sortof wonder how they actually manage to deal with the different
number of days in the months, as well as leap years, but I guess that
would be a reason for the complexity of it.
But still - why *half* days??? Would that be so that they can express
time during the day as seconds in a 16-bit word, since a full day is a
bit more than can be represented in 16 bits?
Anyway, it really is not a way that I think is very nice.
RT-11 does it vaguely like this: days since epoch and
time in seconds, but the difference is that they do use whole days and 17 bit time.
And what about RSTS/E? Don't that one do something like day*1000+year?
I really do prefer what RSX have. And I guess the first point of
problems will be the year 10000. But of course, there are other things
that will break long before that, which are also date related. :-(
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt(a)softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol