Leonard Erickson (1:105/51) schreef aan Arun Jayaprakash op 25-Feb-99 om 04:15:
LE> It's the best way to pack them into 4 bytes. I came up with much
LE> the same thing on my own back in the 70s.
And I, although I stored the last two digits of the year (so 1 to 127, meaning
1901 thru 2027, creating another sort of millennium problem).
The problem is, of course, that the time part doesn't really fit into 16 bits
(60 * 60 * 24 = 86400: much larger then 65535, so you have to use tricks like
this "only storing the EVEN seconds" DOS uses to make it fit).
The date part was easy.
AJ> I realised that. But I don't understand why it was done like this.
AJ> The record could have been a straightforward LongInt instead of
AJ> having two more records that have the same types in them.
The straightforward LongInt is the way UNIX stores them (and because of that a
lot of C-based programs): a pure counter of "seconds since 1/1/1970", SIGNED
32-bits - you CAN go backwards from 1970 too). But presenting this in a nice
"date and time" format is quite a bit more complicated.
/======================================================================
| Orange County Usenet Fidonet gateway
|
| User email address: Eef.Hartman.noemail@webworldinc.com
| User FTN Email gateway: Eef Hartman[RemoveThisportion]@p3.f15.n500.z2.fidonet.org
| User FidoNet address: 2:500/15.3
| Report abuse of this service to joejared@webworldinc.com
|