[fpc-pascal] Extended, Currency and TDateTime memory layout
Marco van de Voort
marcov at stack.nl
Fri Aug 6 17:41:07 CEST 2010
In our previous episode, Michael Van Canneyt said:
> > Similarly, it seams that most often TDateTime=double. Any docs on the
> > memory layout of TDateTime?
>
> TDateTime IS a double.
>
> The integer part is the number of days since 1/1/1900
No, since 12/30/1899. While the above definition was originally meant, it
was adjusted later to account for (very) old Excels not handling leapyears
well. So when they corrected leapyear handling, they adjusted the startdate
to remain compatble with the older excels.
> I also think this is not a Borland invention, but is introduced by
> Microsoft for variant datetime values.
Afaik it comes from Excel, and got into COM that way.
More information about the fpc-pascal
mailing list