From 492a0ffcac7035e9f096e353db41bacabedcc91d Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 20 Jun 2021 08:00:01 +0000 Subject: [PATCH] =?UTF-8?q?*=20Better=20precision=20for=20samedatetime.=20?= =?UTF-8?q?Issue=20ID=20#39023,=20patch=20by=20Zoran=20Vu=C4=8Denovi=C4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: trunk@49517 - --- packages/rtl-objpas/src/inc/dateutil.inc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/rtl-objpas/src/inc/dateutil.inc b/packages/rtl-objpas/src/inc/dateutil.inc index 0588d96457..08eef7e4bf 100644 --- a/packages/rtl-objpas/src/inc/dateutil.inc +++ b/packages/rtl-objpas/src/inc/dateutil.inc @@ -2060,8 +2060,21 @@ end; Function SameDateTime(const A, B: TDateTime): Boolean; + + function MS(X: Double): Int64; + begin + if X >= 0 then + X := X * MSecsPerDay + 0.5 + else if X > -1.0 then + X := -X * MSecsPerDay + 0.5 + else + X := X * MSecsPerDay - 0.5; + + Result := Trunc(X); + end; + begin - Result:=Abs(A-B)