[Lazarus] DateDif function needed

Michael Van Canneyt michael at freepascal.org
Sat Nov 9 16:54:18 CET 2013



On Sat, 9 Nov 2013, J├╝rgen Hestermann wrote:

>
> Am 2013-11-09 13:43, schrieb Michael Van Canneyt:
>> So what ? Do an EncodeDate() and you're all set.
>> 
> That would be a real performance hit (i.e. when sorting by date)
> if you have stored dates in year, month, day... format.
> Each comparison then needs multiple convertions each time.

Not if you store everything as a DateTime and use that. The format is such that it sorts naturally.

But hey, who am I to try and convince you ?

Michael.


More information about the Lazarus mailing list