Forum > FPC development

DateUtils.Inc* with double instead on Int64

<< < (3/9) > >>

PascalDragon:

--- Quote from: MarkMLl on June 07, 2022, 02:01:15 pm ---Pardon me for jumping in, but can anybody comment on why TDateTime isn't an (80-bit) extended on platforms that support it?

--- End quote ---

Because Delphi did so. And the accuracy of Double is probably sufficient for the intended purpose.

winni:
Hi!

TDateTime is a Double since Delphi 1.0

So ask Borland ....

Winni

MarkMLl:

--- Quote from: PascalDragon on June 07, 2022, 02:10:08 pm ---Because Delphi did so. And the accuracy of Double is probably sufficient for the intended purpose.

--- End quote ---

Hmm. But we're both  further from the epoch (1900?) than when Borland selected it (late 90s?) and expecting to be able to use smaller intervals for timeouts etc. as computers speed up (assuming, of course, that that trend continues).

Since a TDateTime should be treated as opaque, is binary compatibility that important?

MarkMLl

SymbolicFrank:
Exact time is a bit more challenging, as you need 144 bits to store the amount of Planck time units for each second. So, if we take 192 bits for that and add the 64 bits for the seconds, we end up with 256 bits and a universe-shattering precision that is never going to be outdated :)

Edit: if you count seconds in Planck time, the value won't be exact, but extremely close. And as you convert from a large integer of Planck time to days and seconds, it doesn't matter.

winni:

--- Quote from: MarkMLl on June 07, 2022, 02:43:44 pm ---Since a TDateTime should be treated as opaque, is binary compatibility that important?

MarkMLl

--- End quote ---

Hi!

There is so much code around since more than 25 years that relies on the internal structure of TDateTime.
If you change this you break a lot of existing code.

TDateTime is sufficient for Office Apps.
If you got other needs then use another Type of DateTime.

If you make historical  research the use the Julian Days.

If you need milliseconds then use QWords like getTickCount64.

Winni

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version